home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 6
/
FM Towns Free Software Collection 6.iso
/
t_os
/
algernon
/
mcedit.bas
< prev
next >
Wrap
BASIC Source File
|
1993-07-08
|
66KB
|
1,619 lines
100 '-------------------- VIL組み込み開始 --------------------
110 CLEAR ,,512,1024*700,0,0 'メモリ領域設定
120 SCREEN 0:CLS
130 VIL_W0=0:VIL_W1=0:VIL_W2=0:VIL_W3=0:VIL_W4=0 '汎用ワーク変数
140 VIL_W5=0:VIL_W6=0:VIL_W7=0:VIL_W8=0:VIL_W9=0
150 VIL_W0$="":VIL_W1$="":VIL_W2$="":VIL_W3$=""
160 VIL_I=0:VIL_J=0:VIL_K=0 'ループ変数
170 VIL_A$="" '文字列汎用
180 VIL_F$="" 'ファイル名汎用
190 VIL_C=15:VIL_CB=0 '描画色・背景色(0..15)
200 VIL_X=0:VIL_Y=0:VIL_W=0:VIL_Z=0 '左上隅・右下隅座標
210 VIL_XL=0:VIL_YL=0:VIL_XN=0:VIL_YN=0 'X・Y軸方向長さ・個数
220 VIL_P=0 'パレット番号
225 VIL_KN=0 '入力番号
226 VIL_K$="":VIL_KY=0 '入力キーとアスキーコード
227 VIL_MX=0:VIL_MY=0:VIL_MW=0:VIL_MZ=0 'マウス位置
230 '
240 VIL_E=0 'エラー番号
250 VIL_DIR$="" 'VILディレクトリ
260 VIL_FMTDIR$="" 'FMTITLEディレクトリ
270 VIL_VER=100 'VIL VER1.00
280 '
290 *VIL_CNF '設定ファイル"CONFIG.VIL"読込
300 PRINT"Searching "+CHR$(34)+"CONFIG.VIL"+CHR$(34)
310 PRINT"Searching current directory"
320 GOSUB *VIL_ERR_ON:VIL_E=0
330 OPEN "I",#1,"CONFIG.VIL" 'カレントディレクトリを探す
340 IF VIL_E=63 THEN
350 PRINT"Searching root directory"
360 VIL_E=0
370 OPEN "I",#1,"\CONFIG.VIL" 'ルートディレクトリを探す
380 IF VIL_E=63 THEN '見つからなければ設定中止
390 PRINT"WARNING:"+CHR$(34)+"CONFIG.VIL"+CHR$(34)+" not found"
400 GOTO *VIL_L_BGN
410 ENDIF
420 ENDIF
430 PRINT"Reading "+CHR$(34)+"CONFIG.VIL"+CHR$(34)
440 WHILE EOF(1)=0
450 LINE INPUT #1,VIL_W0$
460 IF LEFT$(VIL_W0$,1)<>"'" THEN 'コメント行スキップ
470 IF INSTR(VIL_W0$,"VILDIR") THEN 'VILディレクトリ設定
480 VIL_DIR$=MID$(VIL_W0$,INSTR(VIL_W0$,"=")+1)
490 ELSE IF INSTR(VIL_W0$,"FMTITLEDIR") THEN 'FMTITLEディレクトリ設定
500 VIL_FMTDIR$=MID$(VIL_W0$,INSTR(VIL_W0$,"=")+1)
510 ENDIF
520 ENDIF
530 WEND
540 CLOSE #1
550 '
560 *VIL_L_BGN ' VIL リンク開始
570 ON ERROR GOTO 0
610 *VIL_L_END ' VIL リンク終了
620 '
630 GOSUB *VIL_ERR_ON
640 GOSUB *VIL_DEFFN:GOTO *VIL_INITEND
650 '
660 *VIL_ERR_ON:ON ERROR GOTO *VIL_ERR:RETURN
670 *VIL_ERR:VIL_E=ERR:RESUME NEXT
680 '
690 *VIL_DEFFN
700 ' S$:文字列に変換 SS$:左にスペースを詰める S0$:左に0を詰める
710 ' P :正の整数 I :整数 R :実数
720 DEF FNVIL_P2S$(X) =MID$(STR$(X),2)
730 DEF FNVIL_P2SS$(X,Y)=RIGHT$(" "+STR$(X),Y)
740 DEF FNVIL_P2S0$(X,Y)=RIGHT$("0000000000"+MID$(STR$(X),2),Y)
750 DEF FNVIL_I2S$(X) =MID$(STR$(X),1-(X>=0))
760 DEF FNVIL_I2SS$(X,Y)=RIGHT$(" "+STR$(X),Y)
770 '符号1桁(+-) + 00… + 数値
780 DEF FNVIL_I2S0$(X,Y) =MID$("+-",1-(X<0),1) +RIGHT$("0000000000"+MID$(STR$(ABS(X)),2),Y-1)
790 DEF FNVIL_R2S$(X) =MID$(STR$(X),1-(X>=0))
800 DEF FNVIL_R2SS$(X,Y,Z)=RIGHT$(" "+STR$(FIX(X)),Y)+"." +MID$("0000000000"+STR$(X)+"0000000000" ,INSTR("0000000000"+STR$(X),".")+1,Z)
810 DEF FNVIL_R2S0$(X,Y,Z)=MID$("+-",1-(X<0),1)+RIGHT$("0000000000" +MID$(STR$(FIX(ABS(X))),2),Y-1)+MID$("0000000000"+STR$(X)+"0000000000" ,INSTR("0000000000"+STR$(X),".")+1,Z)
820 RETURN
830 '
840 *VIL_INITEND
850 '-------------------- VIL組み込み終了 --------------------
10000 '<<<<<<<<<<<<<<<<<<<< MOUSE CURSOR EDITOR >>>>>>>>>>>>>>>>>>>>
10040 PLAY OFF
10045 'ON ERROR GOTO 0'***
10220 '<<<<<<<<<<<<<<<<<<<< VIL INITIALIZE >>>>>>>>>>>>>>>>>>>>
10230 '
10240 GOSUB *VIL_BEEP_INITM
10250 '
10260 VIL_W0=1024*500\2 '画面退避(最大ウィンドウ総面積)
10270 VIL_W1=20 '最大ウィンドウ番号
10280 GOSUB *VIL_WIN_INITM
10290 '
10300 VIL_W0=110 '最大メニュー番号
10310 VIL_W1=256 '最大ボックス数
10320 GOSUB *VIL_MSEL_INITM
10330 GOSUB *VIL_INP_INITM
10340 '
10350 VIL_W0= 99 '最大ウィンドウ通し番号
10360 VIL_W1=128 'ウィンドウ枠色初期設定 (G)
10370 VIL_W2=128 ' (R)
10380 VIL_W3=128 ' (B)
10390 VIL_W4= 8 'ウィンドウ背景色用パレット番号
10400 VIL_W5= 0 'ウィンドウ背景色初期設定(G)
10410 VIL_W6= 0 ' (R)
10420 VIL_W7= 0 ' (B)
10430 GOSUB *VIL_VWM_INITM
10440 GOSUB *VIL_SEL_INITM
10450 '
10460 VIL_W0=160:VIL_W1=80
10470 GOSUB *VIL_SYSCNF_INITM
10480 '
10490 VIL_W0=160+32:VIL_W1=80+32 '色設定ウィンドウ左上隅座標
10492 VIL_W2=160+64:VIL_W3=80+64 'パレット設定ウィンドウ左上隅座標
10494 VIL_W4=-1 '表示輝度(高輝度)
10496 VIL_W5=128 'ウィンドウ枠色初期設定 (G)
10498 VIL_W6=128 'ウィンドウ枠色初期設定 (R)
10500 VIL_W7=128 'ウィンドウ枠色初期設定 (B)
10502 GOSUB *VIL_COLCNF_INITM
10504 '
10506 VIL_W0=160+32:VIL_W1=80+32 'BGM設定ウィンドウ左上隅座標
10508 GOSUB *VIL_BGM_INITM
10510 '
10512 VIL_W0=160+64:VIL_W1=80+64 'BGM-FMウィンドウ左上隅座標
10514 VIL_W2=160+96:VIL_W3=80+16 '曲選択ウィンドウ左上隅座標
10516 VIL_W4=63 'MMLデータ数
10518 VIL_W5=16 '曲データ数
10520 GOSUB *VIL_BGMFM_INITM
10522 '
10524 VIL_W0=160+64:VIL_W1=80+64 'BGM-CDウィンドウ左上隅座標
10526 GOSUB *VIL_BGMCD_INITM
10528 '
10530 '--------------------------------------------------------------------
10532 *VIL_MCEDIT
10534 ' マウスカーソル・エディタ
10540 '
10550 VIL_FNAM$=""
10551 VIL_WX=80:VIL_WY=80
10552 CLS
10553 '
10560 'FNAM$ :ファイル名
10570 '
10580 DIM VIL_PAT%(15,15) '0:BLACK,1:WHITE,2:BACK
10590 PALETTE 7,[255,255,255]
10600 PALETTE 6,[160,160,160]
10610 VIL_MCAND$="":VIL_MCDOT$=""
10620 VIL_MCX=-1:VIL_MCY=-1
10630 'SETUP SCREEN
10640 VIL_WW=VIL_WX+343:VIL_WZ=VIL_WY+290
10650 VIL_VWT$="ALGERNON":VIL_VWAT=4:VIL_VWN=0
10660 GOSUB *VIL_VWOPEN
10670 SYMBOL(8,2),"MOUSE CURSOR EDITOR",1,1,4,,,3
10680 LINE(8,24)-(264,280),PSET,%6,B
10690 LINE(272,24)-(289,41),PSET,%6,B
10700 LINE(300,24)-(339,43),PSET,7,BF
10710 GOSUB 11480
10720 RESTORE 12870
10730 FOR VIL_I=1 TO 9
10740 READ VIL_W0$
10750 SYMBOL(276,VIL_I*22+32),FNVIL_P2S$(VIL_I)+" "+VIL_W0$,1,1,7
10760 LINE(274,VIL_I*22+30)-(333,VIL_I*22+47),PSET,%6,B
10770 NEXT
10780 GOSUB 12820
10790 VIL_BCE=0
10800 'MAIN MENU
10810 LINE(268,46)-(339,251),PSET,7,B
10820 VIL_X=272:VIL_Y=50:VIL_W=335:VIL_Z=71
10830 VIL_YL=22:VIL_XN=1:VIL_YN=9:VIL_C=15:VIL_MN=80
10840 GOSUB *VIL_MSEL
10850 LINE(268,46)-(339,251),PSET,%8,B
10860 GOSUB 12760
10870 IF VIL_KN>0 THEN
10880 ON VIL_KN GOSUB 10920,10920,10920,11130,11350,11640,11730,11730,*VIL_SYSCNF
10890 ENDIF
10900 GOTO 10810
10910 'EDIT
10920 VIL_W5=VIL_KN
10930 VIL_X=8:VIL_Y=24:VIL_W=24:VIL_Z=40
10940 VIL_XL=16:VIL_YL=16:VIL_XN=9:VIL_YN=1:VIL_BCE=0
10950 GOSUB *VIL_BCMAKE
10960 VIL_XN=16:VIL_YN=16:VIL_C=12:VIL_MN=81
10970 GOSUB *VIL_MSELIN
10980 IF VIL_KN>0 THEN
10990 VIL_X=(VIL_KN-1) MOD 16:VIL_Y=(VIL_KN-1)\16
11000 VIL_C=-(VIL_W5=2)*15-(VIL_W5=3)*9
11010 LINE(VIL_X*16+ 9,VIL_Y*16+25) -(VIL_X*16+23,VIL_Y*16+39),PSET,%VIL_C,BF
11020 PSET(VIL_X+273,VIL_Y+25),%VIL_C
11030 PSET(VIL_X+302,VIL_Y+26),%(-(VIL_C<>0)*15)
11040 VIL_PAT%(VIL_X,VIL_Y)=VIL_W5-1
11050 ELSE IF VIL_KN=0 THEN
11060 VIL_C=12:GOSUB *VIL_BC
11070 RETURN
11080 ELSE
11090 GOSUB 12760
11100 ENDIF
11110 GOTO 10960
11120 'POINT
11130 VIL_X=8:VIL_Y=24:VIL_W=24:VIL_Z=40
11140 VIL_XL=16:VIL_YL=16:VIL_XN=9:VIL_YN=1:VIL_BCE=0
11150 GOSUB *VIL_BCMAKE
11160 VIL_XN=16:VIL_YN=16:VIL_C=12:VIL_MN=81
11170 GOSUB *VIL_MSELIN
11180 IF VIL_KN>0 THEN
11190 IF VIL_MCX>=0 THEN
11200 VIL_C=-(VIL_PAT%(VIL_MCX,VIL_MCY)=1)*15 -(VIL_PAT%(VIL_MCX,VIL_MCY)=2)*9
11210 LINE(VIL_MCX*16+ 9,VIL_MCY*16+25) -(VIL_MCX*16+23,VIL_MCY*16+39),PSET,%VIL_C,BF
11220 ENDIF
11230 VIL_MCX=(VIL_KN-1) MOD 16:VIL_MCY=(VIL_KN-1)\16
11240 LINE(VIL_MCX*16+12,VIL_MCY*16+28) -(VIL_MCX*16+20,VIL_MCY*16+36),PSET,2,BF
11250 VIL_C=12:GOSUB *VIL_BC
11260 RETURN
11270 ELSE IF VIL_KN=0 THEN
11280 VIL_C=12:GOSUB *VIL_BC
11290 RETURN
11300 ELSE
11310 GOSUB 12760
11320 ENDIF
11330 GOTO 11130
11340 'CLEAR
11350 VIL_WX=VIL_WX+48:VIL_WY=VIL_WY+160:VIL_WW=VIL_WX+175:VIL_WZ=VIL_WY+55
11360 VIL_VWT$="CLEAR":VIL_VWAT=0
11370 GOSUB *VIL_VWOPEN
11380 SYMBOL(8,8),"データをクリアします",1,1,7
11390 VIL_X=44:VIL_Y=28
11400 GOSUB *VIL_SEL_DO
11410 IF VIL_KN<1 THEN
11420 GOSUB 12760
11430 GOTO 11390
11440 ENDIF
11450 GOSUB *VIL_VWCLOSE
11460 IF VIL_KN=2 THEN RETURN
11470 '
11480 FOR VIL_Y=0 TO 15
11490 FOR VIL_X=0 TO 15
11500 VIL_PAT%(VIL_X,VIL_Y)=2
11510 NEXT
11520 NEXT
11530 LINE(9,25)-(263,279),PSET,1,BF
11540 FOR VIL_X=24 TO 248 STEP 16
11550 LINE(VIL_X,24)-(VIL_X,280),PSET,%6
11560 NEXT
11570 FOR VIL_Y=40 TO 264 STEP 16
11580 LINE(8,VIL_Y)-(264,VIL_Y),PSET,%6
11590 NEXT
11600 LINE(273,25)-(288,40),PSET,1,BF
11610 LINE(300,24)-(339,43),PSET,7,BF
11620 RETURN
11630 'SET
11640 GOSUB 12610
11650 VIL_W0$="":VIL_W1$=""
11660 FOR VIL_I=1 TO 63 STEP 2
11670 VIL_W0$=VIL_W0$+CHR$(VAL("&H"+MID$(VIL_MCAND$,VIL_I,2)))
11680 VIL_W1$=VIL_W1$+CHR$(VAL("&H"+MID$(VIL_MCDOT$,VIL_I,2)))
11690 NEXT
11700 MOUSE 2,VIL_W0$,VIL_W1$,-VIL_MCX*(VIL_MCX>=0),-VIL_MCY*(VIL_MCX>=0)
11710 RETURN
11720 'LOAD & SAVE
11730 VIL_W5=(VIL_KN=8) '0:LOAD / -1:SAVE
11740 VIL_WX=VIL_WX+48:VIL_WY=VIL_WY+160:VIL_WW=VIL_WX+351:VIL_WZ=VIL_WY+31
11750 VIL_VWT$=MID$("LOADSAVE",1-VIL_W5*4,4)+" NAME":VIL_VWAT=0
11760 GOSUB *VIL_VWOPEN
11770 SYMBOL(8,8),KMID$("ロードセーブ",1-VIL_W5*3,3)+"名:",1,1,7
11780 VIL_A$=VIL_FNAM$
11790 VIL_X=80:VIL_Y=8:VIL_C=15:VIL_CB=8:VIL_L=32
11800 GOSUB *VIL_INPSTR
11810 IF VIL_KN=-2 OR (VIL_KN=-1 AND VIL_MW=-1) THEN
11820 VIL_W0$=VIL_A$
11830 GOSUB 12760
11840 IF VIL_VWMR=8 THEN RETURN
11850 VIL_A$=VIL_W0$
11860 GOTO 11790
11870 ELSE IF VIL_KN=0 THEN
11880 GOSUB *VIL_VWCLOSE
11890 ELSE
11900 VIL_FNAM$=VIL_A$
11910 VIL_WX=VIL_WX+48:VIL_WY=VIL_WY+48
11920 VIL_WW=VIL_WX+175:VIL_WZ=VIL_WY+55
11930 VIL_VWT$=MID$("LOADSAVE",1-VIL_W5*4,4)+" SURE":VIL_VWAT=0
11940 GOSUB *VIL_VWOPEN
11950 SYMBOL(8,8),"データを"+KMID$("ロードセーブ",1-VIL_W5*3,3)+"します", 1,1,7
11960 VIL_X=44:VIL_Y=28
11970 GOSUB *VIL_SEL_DO
11980 IF VIL_KN<1 THEN
11990 GOSUB 12760
12000 GOTO 11960
12010 ENDIF
12020 GOSUB *VIL_VWCLOSE:GOSUB *VIL_VWCLOSE
12030 IF VIL_KN=2 THEN RETURN
12040 IF VIL_W5=0 THEN 'LOAD
12050 VIL_E=0
12060 OPEN "I",#1,VIL_FNAM$
12070 IF VIL_E=63 THEN
12080 STOP
12090 ENDIF
12100 LINE INPUT #1,VIL_W0$:VIL_MCX=VAL(MID$(VIL_W0$,15))
12110 LINE INPUT #1,VIL_W0$:VIL_MCY=VAL(MID$(VIL_W0$,15))
12120 LINE INPUT #1,VIL_W0$':VIL_MCAND$=MID$(VIL_W0$,19,64)
12121 VIL_W0=0:VIL_MCAND$=""
12122 FOR VIL_I=0 TO 31
12123 VIL_W0=INSTR(VIL_W0+1,VIL_W0$,"&H")+2
12124 VIL_MCAND$=VIL_MCAND$+MID$(VIL_W0$,VIL_W0,2)
12125 NEXT
12128 '
12130 LINE INPUT #1,VIL_W0$':VIL_MCDOT$=MID$(VIL_W0$,19,64)
12131 VIL_W0=0:VIL_MCDOT$=""
12132 FOR VIL_I=0 TO 31
12133 VIL_W0=INSTR(VIL_W0+1,VIL_W0$,"&H")+2
12134 VIL_MCDOT$=VIL_MCDOT$+MID$(VIL_W0$,VIL_W0,2)
12135 NEXT
12138 '
12140 FOR VIL_Y=0 TO 15
12150 VIL_W0=32768
12160 VIL_W1=VAL("&H"+MID$(VIL_MCAND$,VIL_Y*4+1,4))
12170 VIL_W2=VAL("&H"+MID$(VIL_MCDOT$,VIL_Y*4+1,4))
12180 FOR VIL_X=0 TO 15
12190 VIL_PAT%(VIL_X,VIL_Y)=-((VIL_W1 AND VIL_W0)>0)*2 -((VIL_W2 AND VIL_W0)>0)
12200 VIL_C=-(VIL_PAT%(VIL_X,VIL_Y)=1)*15 -(VIL_PAT%(VIL_X,VIL_Y)=2)*9
12210 LINE(VIL_X*16+ 9,VIL_Y*16+25) -(VIL_X*16+23,VIL_Y*16+39),PSET,%VIL_C,BF
12220 PSET(VIL_X+273,VIL_Y+25),%VIL_C
12230 PSET(VIL_X+302,VIL_Y+26),%(-(VIL_C<>0)*15)
12240 VIL_W0=VIL_W0\2
12250 NEXT
12260 NEXT
12270 IF VIL_MCX>=0 THEN
12280 LINE(VIL_MCX*16+12,VIL_MCY*16+28) -(VIL_MCX*16+20,VIL_MCY*16+36),PSET,2,BF
12290 ENDIF
12300 CLOSE #1
12310 ELSE 'SAVE
12320 GOSUB 12610
12330 VIL_E=0
12340 OPEN "O",#1,VIL_FNAM$
12350 IF VIL_E=64 THEN
12360 VIL_WX=VIL_WX+48:VIL_WY=VIL_WY+160
12370 VIL_WW=VIL_WX+287:VIL_WZ=VIL_WY+55
12380 VIL_VWT$="SURE":VIL_VWAT=0
12390 GOSUB *VIL_VWOPEN
12400 SYMBOL(8,8),"指定のファイルは既に存在しています",1,1,7
12410 VIL_X=100:VIL_Y=28
12420 GOSUB *VIL_SEL_DO
12430 IF VIL_KN<1 THEN
12440 GOSUB 12760
12450 GOTO 12410
12460 ENDIF
12470 GOSUB *VIL_VWCLOSE
12480 IF VIL_KN=2 THEN GOSUB *VIL_VWCLOSE:RETURN
12490 KILL VIL_FNAM$:GOTO 12330
12500 ENDIF
12510 PRINT #1,"60000 VIL_MCX="+FNVIL_P2S$(VIL_MCX)
12520 PRINT #1,"60010 VIL_MCY="+FNVIL_P2S$(VIL_MCY)
12521 '
12522 VIL_W0$="60020 VIL_MCA$=CHR$(&H"+MID$(VIL_MCAND$,1,2)
12523 FOR VIL_I=0 TO 30
12524 VIL_W0$=VIL_W0$+",&H"+MID$(VIL_MCAND$,VIL_I*2+3,2)
12525 NEXT
12530 PRINT #1,VIL_W0$+")"
12541 '
12542 VIL_W0$="60030 VIL_MCD$=CHR$(&H"+MID$(VIL_MCDOT$,1,2)
12543 FOR VIL_I=0 TO 30
12544 VIL_W0$=VIL_W0$+",&H"+MID$(VIL_MCDOT$,VIL_I*2+3,2)
12545 NEXT
12546 PRINT #1,VIL_W0$+")"
12550 CLOSE #1
12560 ENDIF
12570 ENDIF
12580 RETURN
12590 '
12600 'MAKE STRING
12610 VIL_MCAND$="":VIL_MCDOT$=""
12620 FOR VIL_Y=0 TO 15
12631 FOR VIL_I=0 TO 1
12635 VIL_W0=0:VIL_W1=0
12640 FOR VIL_X=0 TO 7
12650 VIL_W0=(VIL_W0-(VIL_PAT%(VIL_I*8+VIL_X,VIL_Y)=2))*2
12660 VIL_W1=(VIL_W1-(VIL_PAT%(VIL_I*8+VIL_X,VIL_Y)=1))*2
12670 'PRINT -(VIL_PAT%(VIL_I*8+VIL_X,VIL_Y)=2);' PRINT VIL_W0;VIL_W1
12680 NEXT
12682 'PRINT HEX$(VIL_W0\2)'PRINT HEX$(VIL_W0);
12690 VIL_MCAND$=VIL_MCAND$+RIGHT$("00"+HEX$(VIL_W0\2),2)
12700 VIL_MCDOT$=VIL_MCDOT$+RIGHT$("00"+HEX$(VIL_W1\2),2)
12710 ' PRINT VIL_MCAND$;"|";VIL_MCDOT$:A$=INPUT$(1)
12715 NEXT
12720 NEXT
12730 RETURN
12740 '
12750 'CHECK VWM AND VST
12760 GOSUB *VIL_VWMCHECK
12770 IF VIL_VWMR=4 AND VIL_WT$="ALGERNON" THEN GOSUB 12820
12780 'GOSUB *VIL_STCHECK
12790 RETURN
12800 '
12810 'MAKE BOX FOR PATTERN EDIT
12820 VIL_X=8:VIL_Y=24:VIL_W=24:VIL_Z=40
12830 VIL_XL=16:VIL_YL=16:VIL_XN=16:VIL_YN=16
12840 GOSUB *VIL_BCMAKE
12850 RETURN
12860 '
12870 DATA "BLACK","WHITE","BACK","POINT","CLEAR","SET","LOAD","SAVE","SYS"
12880 'SCALE--------2---------3---------4---------5---------6---------7-----*--*8
40030 *VIL_BAS_VER
40035 VIL_VER=100
40040 RETURN
40070 *VIL_BEEP_INITM
40120 RETURN
40130 *VIL_GBEEP
40170 FOR VIL_K=1 TO 4:BEEP 363523,5,400:WAIT 5:NEXT
40175 RETURN
40185 *VIL_BBEEP
40225 BEEP 363523,40,80:WAIT 40
40230 RETURN
40270 *VIL_WIN_INITM
40320 VIL_WX=0:VIL_WY=0
40325 VIL_WW=0:VIL_WZ=0
40330 VIL_WUB=0:VIL_WDB=0
40335 VIL_WLB=0:VIL_WRB=0
40340 VIL_WAN=0
40345 VIL_WPM=0
40350 VIL_WBUFMAX=VIL_W0
40355 VIL_WANMAX=VIL_W1
40360 DIM VIL_WBUF%(VIL_W0)
40365 DIM VIL_WBUFO(VIL_W1)
40370 DIM VIL_WX(VIL_W1),VIL_WY(VIL_W1)
40375 DIM VIL_WW(VIL_W1),VIL_WZ(VIL_W1)
40385 VIL_WX(0)= 0:VIL_WY(0)= 0
40390 VIL_WW(0)=639:VIL_WZ(0)=479
40400 RETURN
40410 *VIL_WOP
40480 GOSUB *VIL_WPMA
40485 VIL_WAN=VIL_WAN+1
40490 VIL_WX(VIL_WAN)=VIL_WX:VIL_WY(VIL_WAN)=VIL_WY
40495 VIL_WW(VIL_WAN)=VIL_WW:VIL_WZ(VIL_WAN)=VIL_WZ
40500 VIL_WBUFO(VIL_WAN)=VIL_WBUFO(VIL_WAN-1) +INT((INT((VIL_WW-VIL_WX+VIL_WLB+VIL_WRB+8)/8) *(VIL_WZ-VIL_WY+VIL_WUB+VIL_WDB+1)*4+1)/2)
40505 VIL_E=0
40510 GET@A(VIL_WX-VIL_WLB,VIL_WY-VIL_WUB)-(VIL_WW+VIL_WRB,VIL_WZ+VIL_WDB), VIL_WBUF%,VIL_WBUFO(VIL_WAN-1)
40515 IF VIL_E THEN
40520 VIL_WAN=VIL_WAN-1
40525 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
40530 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
40535 ENDIF
40540 RETURN
40550 *VIL_WCL
40600 GOSUB *VIL_WPMA
40605 PUT@A(VIL_WX(VIL_WAN)-VIL_WLB,VIL_WY(VIL_WAN)-VIL_WUB) -(VIL_WW(VIL_WAN)+VIL_WRB,VIL_WZ(VIL_WAN)+VIL_WDB), VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN-1)
40610 VIL_WAN=VIL_WAN-1
40615 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
40620 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
40625 RETURN
40635 *VIL_WCLDMY
40685 GOSUB *VIL_WPMA
40690 VIL_WAN=VIL_WAN-1
40695 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
40700 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
40705 RETURN
40715 *VIL_WCLALL
40765 WHILE VIL_WAN
40770 GOSUB *VIL_WCL
40775 WEND
40780 RETURN
40790 *VIL_WPMR
40830 VIL_WPM=-1
40835 VIEW(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ)
40840 WINDOW(0,0)-(VIL_WW-VIL_WX,VIL_WZ-VIL_WY)
40845 RETURN
40855 *VIL_WPMA
40895 VIL_WPM=0
40900 VIEW(0,0)-(639,479)
40905 WINDOW(0,0)-(639,479)
40910 RETURN
40940 *VIL_MSEL_INITM
40990 VIL_MN=0
40995 VIL_BN=0
41000 VIL_BCE=0
41005 VIL_BXDIR=0
41025 DIM VIL_BXX(VIL_W1),VIL_BXY(VIL_W1)
41030 DIM VIL_BXW(VIL_W1),VIL_BXZ(VIL_W1)
41035 DIM VIL_BN(VIL_W0)
41045 FOR VIL_I=1 TO VIL_W0
41050 VIL_BN(VIL_I)=1
41055 NEXT
41065 MOUSE 0:MOUSE 1,320,240,0
41070 RETURN
41080 *VIL_MSEL
41260 GOSUB *VIL_BCMAKE
41265 GOSUB *VIL_MSELIN
41270 RETURN
41280 *VIL_BCMAKE
41370 IF VIL_BXDIR AND 2 THEN VIL_W1=-1 ELSE VIL_W1=1
41375 IF VIL_BXDIR AND 4 THEN VIL_W2=-1 ELSE VIL_W2=1
41380 FOR VIL_I=1 TO VIL_YN
41385 FOR VIL_J=1 TO VIL_XN
41390 IF VIL_BXDIR AND 1 THEN
41395 VIL_W0=(VIL_J-1)*VIL_YN+VIL_I
41400 ELSE
41405 VIL_W0=(VIL_I-1)*VIL_XN+VIL_J
41410 ENDIF
41415 VIL_BXX(VIL_W0)=VIL_X+(VIL_J-1)*VIL_XL*VIL_W1
41420 VIL_BXY(VIL_W0)=VIL_Y+(VIL_I-1)*VIL_YL*VIL_W2
41425 VIL_BXW(VIL_W0)=VIL_W+(VIL_J-1)*VIL_XL*VIL_W1
41430 VIL_BXZ(VIL_W0)=VIL_Z+(VIL_I-1)*VIL_YL*VIL_W2
41435 NEXT
41440 NEXT
41445 RETURN
41455 *VIL_MSELIN
41630 VIL_W0=MOUSE(3,0)+MOUSE(3,1)
41635 VIL_W0=VIL_XN*VIL_YN
41640 VIL_W1=28:VIL_W2=29:VIL_W3=30:VIL_W4=31
41645 IF VIL_BXDIR AND 2 THEN SWAP VIL_W1,VIL_W2
41650 IF VIL_BXDIR AND 4 THEN SWAP VIL_W3,VIL_W4
41655 IF VIL_BXDIR AND 1 THEN SWAP VIL_W1,VIL_W4:SWAP VIL_W2,VIL_W3
41675 MOUSE 1,,,1
41680 IF VIL_MN THEN VIL_BN=VIL_BN(VIL_MN)
41685 IF VIL_BN<1 OR VIL_W0<VIL_BN THEN VIL_BN=1
41690 IF VIL_BCE=0 THEN GOSUB *VIL_BC
41700 VIL_K$=INKEY$
41705 IF VIL_K$<>"" THEN VIL_KY=ASC(VIL_K$) ELSE VIL_KY=0
41715 IF MOUSE(3,1) OR VIL_KY=48 OR VIL_KY=24 THEN
41720 VIL_W0=MOUSE(3,0)
41725 VIL_KN=0
41730 ELSE IF MOUSE(3,0) OR MOUSE(2,0) THEN
41735 VIL_KN=-1
41740 VIL_MX=MOUSE(0):VIL_MY=MOUSE(1)
41745 IF VIL_WPM THEN
41750 IF VIL_WPM AND VIL_WX<=VIL_MX AND VIL_MX<=VIL_WW AND VIL_WY<=VIL_MY AND VIL_MY<=VIL_WZ THEN
41755 VIL_MW=VIL_MX-VIL_WX:VIL_MZ=VIL_MY-VIL_WY
41760 FOR VIL_I=1 TO VIL_XN
41765 IF VIL_BXX(VIL_I)=<VIL_MW AND VIL_MW=<VIL_BXW(VIL_I) THEN
41770 FOR VIL_J=VIL_I TO VIL_W0 STEP VIL_XN
41775 IF VIL_BXY(VIL_J)=<VIL_MZ AND VIL_MZ=<VIL_BXZ(VIL_J) THEN
41780 VIL_KN=VIL_J
41785 GOSUB *VIL_BC
41790 VIL_BN=VIL_KN
41795 GOSUB *VIL_BC
41800 VIL_I=VIL_W0:VIL_J=VIL_W0
41805 ENDIF
41810 NEXT
41815 ENDIF
41820 NEXT
41825 ENDIF
41830 ELSE
41835 VIL_MW=-1
41840 FOR VIL_I=1 TO VIL_XN
41845 IF VIL_BXX(VIL_I)=<VIL_MX AND VIL_MX=<VIL_BXW(VIL_I) THEN
41850 FOR VIL_J=VIL_I TO VIL_W0 STEP VIL_XN
41855 IF VIL_BXY(VIL_J)=<VIL_MY AND VIL_MY=<VIL_BXZ(VIL_J) THEN
41860 VIL_KN=VIL_J
41865 GOSUB *VIL_BC
41870 VIL_BN=VIL_KN
41875 GOSUB *VIL_BC
41880 VIL_I=VIL_W0:VIL_J=VIL_W0
41885 ENDIF
41890 NEXT
41895 ENDIF
41900 NEXT
41905 ENDIF
41910 ELSE
41915 IF VIL_KY=0 THEN
41920 GOTO 41700
41925 ELSE IF 48<VIL_KY AND VIL_KY<58 THEN
41930 IF VIL_KY<VIL_W0+49 THEN
41935 VIL_KN=VIL_KY-48:GOSUB *VIL_BC
41940 VIL_BN=VIL_KN:GOSUB *VIL_BC
41945 ELSE
41950 VIL_KN=-2
41955 ENDIF
41960 ELSE IF VIL_KY=13 THEN
41965 VIL_KN=VIL_BN
41970 ELSE IF 27<VIL_KY AND VIL_KY<32 THEN
41975 GOSUB *VIL_BC
41980 VIL_BN=VIL_BN-(VIL_KY=VIL_W1)+(VIL_KY=VIL_W2) +((VIL_KY=VIL_W3)-(VIL_KY=VIL_W4))*VIL_XN
41985 VIL_BN=VIL_BN+(VIL_KY=VIL_W1 AND (VIL_BN MOD VIL_XN)=1)*VIL_XN
41990 VIL_BN=VIL_BN-(VIL_KY=VIL_W2 AND ((VIL_BN+1) MOD VIL_XN)=1)*VIL_XN
41995 VIL_BN=VIL_BN-((VIL_BN<1)-(VIL_BN>VIL_W0))*VIL_W0
42000 GOSUB *VIL_BC
42005 GOTO 41700
42010 ELSE
42015 VIL_KN=-2
42020 ENDIF
42025 ENDIF
42035 VIL_BN(VIL_MN)=VIL_BN
42040 MOUSE 1,,,0
42045 VIL_BCE=-1
42050 RETURN
42060 *VIL_BC
42100 LINE(VIL_BXX(VIL_BN),VIL_BXY(VIL_BN)) -(VIL_BXW(VIL_BN),VIL_BXZ(VIL_BN)),XOR,%VIL_C,B
42105 RETURN
42135 *VIL_INP_INITM
42185 MOUSE 0:MOUSE 1,320,240,0
42190 RETURN
42200 *VIL_INPSTR
42325 VIL_W0=LEN(VIL_A$):VIL_W1=VIL_W0
42330 MOUSE 1,,,1
42340 GOSUB *VIL_GPRINT
42345 GOSUB 42560
42355 VIL_K$=INKEY$
42360 IF VIL_K$<>"" THEN VIL_KY=ASC(VIL_K$) ELSE VIL_KY=0
42370 IF MOUSE(3,1) OR VIL_KY=24 THEN
42375 VIL_KN=0
42380 ELSE IF MOUSE(3,0) OR MOUSE(2,0) THEN
42385 VIL_MX=MOUSE(0):VIL_MY=MOUSE(1)
42390 IF VIL_WPM THEN
42395 IF VIL_WPM AND VIL_WX<=VIL_MX AND VIL_MX<=VIL_WW AND VIL_WY<=VIL_MY AND VIL_MY<=VIL_WZ THEN
42400 VIL_MW=VIL_MX-VIL_WX:VIL_MZ=VIL_MY-VIL_WY
42405 ELSE
42410 VIL_MW=-1
42415 ENDIF
42420 ENDIF
42425 VIL_KN=-1
42430 ELSE IF VIL_KY=13 THEN
42435 VIL_KN=1
42440 ELSE
42445 IF VIL_KY=0 THEN 42355
42450 GOSUB 42560
42455 IF VIL_KY=29 AND VIL_W1>0 THEN VIL_W1=VIL_W1-1:GOTO 42345
42460 IF VIL_KY=28 AND VIL_W1<VIL_W0 THEN VIL_W1=VIL_W1+1:GOTO 42345
42465 IF VIL_KY>=32 AND VIL_KY<>127 AND VIL_W0<VIL_L THEN
42470 VIL_A$=LEFT$(VIL_A$,VIL_W1)+VIL_K$+MID$(VIL_A$,VIL_W1+1)
42475 VIL_W0=VIL_W0+1:VIL_W1=VIL_W1+1
42480 ELSE IF VIL_KY=8 AND VIL_W1>0 THEN
42485 VIL_A$=LEFT$(VIL_A$,VIL_W1-1)+MID$(VIL_A$,VIL_W1+1)
42490 VIL_W0=VIL_W0-1:VIL_W1=VIL_W1-1
42495 ELSE IF VIL_KY=127 AND VIL_W1<VIL_W0 THEN
42500 VIL_A$=LEFT$(VIL_A$,VIL_W1)+MID$(VIL_A$,VIL_W1+2)
42505 VIL_W0=VIL_W0-1
42510 ELSE IF VIL_KY=11 THEN
42515 VIL_A$="":VIL_W0=0:VIL_W1=0
42520 ENDIF
42525 GOTO 42340
42530 ENDIF
42535 MOUSE 1,,,0
42540 GOSUB 42560
42545 RETURN
42560 LINE(VIL_X+VIL_W1*8,VIL_Y+17)-(VIL_X+VIL_W1*8+7,VIL_Y+17),XOR,%VIL_C
42565 RETURN
42575 *VIL_GPRINT
42635 LINE(VIL_X,VIL_Y)-(VIL_X+VIL_L*8-1,VIL_Y+15),PSET,%VIL_CB,BF
42640 SYMBOL(VIL_X,VIL_Y),VIL_A$,1,1,%VIL_C
42645 RETURN
42655 *VIL_MVWAIT
42695 VIL_W0=MOUSE(9)+MOUSE(10):VIL_W0$=INKEY$
42700 WHILE ABS(MOUSE(9))<10 AND ABS(MOUSE(10))<10 AND MOUSE(2,0)+MOUSE(2,1)=0 AND INKEY$="":WEND
42705 RETURN
45030 *VIL_VWM_VER
45035 VIL_VER=100
45040 RETURN
45080 *VIL_VWM_INITM
45155 VIL_VWAT=0:VIL_VWT$=""
45160 VIL_VWXM= 8:VIL_VWYM= 14
45165 VIL_VWWM=631:VIL_VWZM=471
45170 VIL_VWXL= 32:VIL_VWYL= 8
45175 VIL_VWWL=624:VIL_VWZL=458
45180 VIL_VWXD= 1:VIL_VWYD= 1
45185 VIL_VWWD= 1:VIL_VWZD= 1
45190 VIL_VWN=0
45195 VIL_VWMR=0
45200 DIM VIL_VWX(VIL_W0),VIL_VWY(VIL_W0)
45205 DIM VIL_VWW(VIL_W0),VIL_VWZ(VIL_W0)
45210 DIM VIL_VWAT(VIL_WANMAX)
45215 DIM VIL_VWT$(VIL_WANMAX)
45220 DIM VIL_VWN(VIL_WANMAX)
45225 VIL_VWCB=VIL_W4
45230 VIL_MCX0=1:VIL_MCY0=2
45235 VIL_MCA0$=CHR$(&H7F,&HFF,&H3F,&HFF,&H1F,&HFF,&H0F,&HFF,&H07,&HFF,&H03,&HFF,&H01,&HFF,&H00,&HFF,&H00,&H7F,&H00,&H3F,&H00,&H1F,&H00,&HFF,&H00,&HFF,&H18,&H7F,&H38,&H7F,&HFC,&H7F)
45240 VIL_MCD0$=CHR$(&H00,&H00,&H00,&H00,&H40,&H00,&H20,&H00,&H50,&H00,&H38,&H00,&H5C,&H00,&H2E,&H00,&H5F,&H00,&H2F,&H80,&H5E,&H00,&H26,&H00,&H42,&H00,&H03,&H00,&H01,&H00,&H00,&H00)
45245 VIL_MCX1=7: VIL_MCY1=9
45250 VIL_MCA1$=CHR$(&HFE,&H7F,&HF0,&H0F,&HE0,&H07,&HE0,&H01,&H80,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H80,&H00,&H80,&H00,&HC0,&H01,&HC0,&H01,&HE0,&H03,&HF0,&H07,&HFC,&H1F)
45255 VIL_MCD1$=CHR$(&H00,&H00,&H01,&H80,&H0D,&HB0,&H0D,&HB0,&H0D,&HB6,&H6D,&HB6,&H6F,&HF6,&H7F,&HFE,&H7F,&HFE,&H3F,&HFE,&H3F,&HFE,&H1F,&HFC,&H1F,&HFC,&H0F,&HF8,&H03,&HE0,&H00,&H00)
45260 VIL_MCX2=2:VIL_MCY2=12
45265 VIL_MCA2$=CHR$(&HFF,&HE7,&HFF,&H83,&HFE,&H01,&HF8,&H01,&HE0,&H21,&HC0,&H63,&H81,&HC3,&H07,&HC7,&H0F,&H87,&H0F,&H8F,&H0F,&H0F,&H9F,&H1F,&HF0,&H1F,&HE0,&H3F,&HF0,&H7F,&HF0,&HFF)
45270 VIL_MCD2$=CHR$(&H00,&H00,&H00,&H18,&H00,&H7C,&H01,&H8C,&H06,&H08,&H18,&H08,&H20,&H10,&H40,&H10,&H40,&H20,&H40,&H20,&H40,&H40,&H00,&H40,&H00,&H80,&H0F,&H00,&H00,&H00,&H00,&H00)
45280 VIL_WUB=14:VIL_WDB=8:VIL_WRB=8:VIL_WLB=8
45290 PALETTE 1,[VIL_W1-80+(VIL_W1<80)*(VIL_W1-80) ,VIL_W2-80+(VIL_W2<80)*(VIL_W2-80) ,VIL_W3-80+(VIL_W3<80)*(VIL_W3-80)],1
45295 PALETTE 2,[VIL_W1 ,VIL_W2 ,VIL_W3 ]
45300 PALETTE 3,[VIL_W1+80+(255<VIL_W1)*(VIL_W1-255) ,VIL_W2+80+(255<VIL_W2)*(VIL_W2-255) ,VIL_W3+80+(255<VIL_W3)*(VIL_W3-255)],1
45305 PALETTE VIL_VWCB,[VIL_W5,VIL_W6,VIL_W7]
45310 MOUSE 2,VIL_MCA0$,VIL_MCD0$,VIL_MCX0,VIL_MCY0
45320 RETURN
45330 *VIL_VWOPEN
45480 GOSUB *VIL_WPMA
45485 IF VIL_WAN THEN
45490 LINE(VIL_WX(VIL_WAN)+16,VIL_WY(VIL_WAN)-11) -(VIL_WW(VIL_WAN)-16,VIL_WY(VIL_WAN)- 4),XOR,%3,BF
45495 ENDIF
45500 IF VIL_VWN THEN
45505 VIL_WX=VIL_VWX(VIL_VWN):VIL_WY=VIL_VWY(VIL_VWN)
45510 VIL_WW=VIL_VWW(VIL_VWN):VIL_WZ=VIL_VWZ(VIL_VWN)
45515 ENDIF
45520 GOSUB *VIL_WOP
45525 IF VIL_E THEN
45530 LINE(VIL_WX(VIL_WAN)+16,VIL_WY(VIL_WAN)-11) -(VIL_WW(VIL_WAN)-16,VIL_WY(VIL_WAN)- 4),XOR,%3,BF
45535 ENDIF
45545 VIL_VWAT(VIL_WAN)=VIL_VWAT
45550 VIL_VWT$(VIL_WAN)=VIL_VWT$
45555 VIL_VWN (VIL_WAN)=VIL_VWN
45565 LINE(VIL_WX-8,VIL_WY-14)-(VIL_WW+8,VIL_WZ+8),PSET,%VIL_VWCB,BF
45575 LINE(VIL_WX-5,VIL_WY-11)-(VIL_WW+5,VIL_WY-3),PSET,%2,BF
45580 LINE(VIL_WX-5,VIL_WZ+ 3)-(VIL_WW+5,VIL_WZ+5),PSET,%2,BF
45585 LINE(VIL_WX-5,VIL_WY- 2)-(VIL_WX-1,VIL_WZ+2),PSET,%2,BF
45590 LINE(VIL_WW+1,VIL_WY- 2)-(VIL_WW+5,VIL_WZ+2),PSET,%2,BF
45600 CONNECT(VIL_WW+7,VIL_WY-13)-(VIL_WX-7,VIL_WY-13) -(VIL_WX-7,VIL_WZ+ 7),%3
45605 CONNECT(VIL_WW+6,VIL_WY-12)-(VIL_WX-6,VIL_WY-12) -(VIL_WX-6,VIL_WZ+ 6),%3
45610 CONNECT(VIL_WX-6,VIL_WZ+ 7)-(VIL_WW+7,VIL_WZ+ 7) -(VIL_WW+7,VIL_WY-12),%1
45615 CONNECT(VIL_WX-5,VIL_WZ+ 6)-(VIL_WW+6,VIL_WZ+ 6) -(VIL_WW+6,VIL_WY-11),%1
45625 CONNECT(VIL_WW+1,VIL_WY-2)-(VIL_WX-2,VIL_WY-2) -(VIL_WX-2,VIL_WZ+1),%1
45630 CONNECT(VIL_WW ,VIL_WY-1)-(VIL_WX-1,VIL_WY-1) -(VIL_WX-1,VIL_WZ ),%1
45635 CONNECT(VIL_WX-2,VIL_WZ+2)-(VIL_WW+2,VIL_WZ+2) -(VIL_WW+2,VIL_WY-2),%3
45640 CONNECT(VIL_WX-1,VIL_WZ+1)-(VIL_WW+1,VIL_WZ+1) -(VIL_WW+1,VIL_WY-1),%3
45650 IF (VIL_VWAT AND 2)=2 THEN
45655 LINE(VIL_WX-5,VIL_WY-11)-(VIL_WX+3,VIL_WY-3),PSET,%1,B
45660 LINE(VIL_WX-5,VIL_WY-11)-(VIL_WX+3,VIL_WY-3),PSET,%1
45665 LINE(VIL_WX+3,VIL_WY-11)-(VIL_WX-5,VIL_WY-3),PSET,%1
45670 ENDIF
45680 IF (VIL_VWAT AND 4)=4 THEN
45685 LINE(VIL_WX+ 5,VIL_WY-11)-(VIL_WX+13,VIL_WY-3),PSET,%1,B
45690 LINE(VIL_WX+13,VIL_WY-11)-(VIL_WX+ 5,VIL_WY-3),PSET,%1
45695 ENDIF
45705 IF (VIL_VWAT AND 1)=1 THEN
45710 LINE(VIL_WW-13,VIL_WY-11)-(VIL_WW-5,VIL_WY- 3),PSET,%1,B
45715 LINE(VIL_WW-13,VIL_WY- 8)-(VIL_WW-5,VIL_WY- 8),PSET,%1
45720 LINE(VIL_WW-13,VIL_WY- 6)-(VIL_WW-5,VIL_WY- 6),PSET,%1
45725 ENDIF
45735 IF (VIL_VWAT AND 16)=16 THEN
45740 LINE(VIL_WW-3,VIL_WY-11)-(VIL_WW+5,VIL_WY-3),PSET,%1,B
45745 LINE(VIL_WW-3,VIL_WY- 8)-(VIL_WW+2,VIL_WY-3),PSET,%1,B
45750 ENDIF
45760 VIL_W0=INT(VIL_WW-VIL_WX-36)/5
45765 IF VIL_W0>0 THEN
45770 SYMBOL(VIL_WX+18,VIL_WY-10),LEFT$(VIL_VWT$,VIL_W0),.5!,.5!,%1,,,,1
45775 ENDIF
45785 LINE(VIL_WX+16,VIL_WY-11)-(VIL_WW-16,VIL_WY-4),XOR,%3,BF
45790 GOSUB *VIL_WPMR
45795 RETURN
45805 *VIL_VWCLOSE
45890 IF VIL_VWN THEN
45895 VIL_VWX(VIL_VWN)=VIL_WX:VIL_VWY(VIL_VWN)=VIL_WY
45900 VIL_VWW(VIL_VWN)=VIL_WW:VIL_VWZ(VIL_VWN)=VIL_WZ
45905 ENDIF
45910 GOSUB *VIL_WCL
45915 VIL_VWAT=VIL_VWAT(VIL_WAN)
45920 VIL_VWT$=VIL_VWT$(VIL_WAN)
45925 VIL_VWN =VIL_VWN (VIL_WAN)
45930 IF VIL_WAN THEN
45935 LINE(VIL_WX+16,VIL_WY-11)-(VIL_WW-16,VIL_WY-4),XOR,%3,BF
45940 ENDIF
45945 GOSUB *VIL_WPMR
45950 RETURN
45960 *VIL_VWCLOSEDMY
46045 IF VIL_VWN THEN
46050 VIL_VWX(VIL_VWN)=VIL_WX:VIL_VWY(VIL_VWN)=VIL_WY
46055 VIL_VWW(VIL_VWN)=VIL_WW:VIL_VWZ(VIL_VWN)=VIL_WZ
46060 ENDIF
46065 GOSUB *VIL_WCLDMY
46070 LINE(VIL_WX(VIL_WAN+1)+16,VIL_WY(VIL_WAN+1)-11) -(VIL_WW(VIL_WAN+1)-16,VIL_WY(VIL_WAN+1)- 4),XOR,%3,BF
46075 VIL_VWAT=VIL_VWAT(VIL_WAN)
46080 VIL_VWT$=VIL_VWT$(VIL_WAN)
46085 VIL_VWN =VIL_VWN (VIL_WAN)
46090 IF VIL_WAN THEN
46095 LINE(VIL_WX+16,VIL_WY-11)-(VIL_WW-16,VIL_WY-4),XOR,%3,BF
46100 ENDIF
46105 GOSUB *VIL_WPMR
46110 RETURN
46120 *VIL_VWCLOSEALL
46160 GOSUB *VIL_WCLALL
46165 RETURN
46175 *VIL_VWCLS
46210 LINE(0,0)-(VIL_WW-VIL_WX,VIL_WZ-VIL_WY),PSET,%VIL_VWCB,BF
46215 RETURN
46225 *VIL_VWMCHECK
46315 VIL_VWMR=0
46320 IF VIL_KN=-1 THEN
46325 GOSUB *VIL_VWMWIN
46330 ELSE IF VIL_KN=-2 AND VIL_KY=27 THEN
46335 VIL_WX=VIL_WW+(VIL_WW-582)*(VIL_WW>582)
46340 VIL_WY=VIL_WY-32+(VIL_WY- 46)*(VIL_WY< 46) +(VIL_WY-406)*(VIL_WY>406)
46350 GOSUB *VIL_VWMMENU
46355 ENDIF
46360 RETURN
46370 *VIL_VWMWIN
46430 VIL_VWMR=0
46435 IF (VIL_VWAT AND 2)=2 AND VIL_WX- 6<VIL_MX AND VIL_MX<VIL_WX+4 AND VIL_WY-12<VIL_MY AND VIL_MY<VIL_WY-2 THEN
46440 GOSUB *VIL_VWMCLOSE
46445 ELSE IF (VIL_VWAT AND 4)= 4 AND VIL_WX+4<VIL_MX AND VIL_MX<VIL_WX+14 AND VIL_WY-12<VIL_MY AND VIL_MY<VIL_WY-2 THEN
46450 GOSUB *VIL_VWMHIDE
46455 ELSE IF (VIL_VWAT AND 1)= 1 AND VIL_WW-14<VIL_MX AND VIL_MX<VIL_WW-4 AND VIL_WY-12<VIL_MY AND VIL_MY<VIL_WY-2 THEN
46460 VIL_WX=VIL_WW+(VIL_WW-582)*(VIL_WW>582)
46465 VIL_WY=VIL_WY-32+(VIL_WY- 46)*(VIL_WY< 46) +(VIL_WY-406)*(VIL_WY>406)
46475 GOSUB *VIL_VWMMENU
46480 ELSE IF (VIL_VWAT AND 16)=16 AND VIL_WW-4<VIL_MX AND VIL_MX<VIL_WW+6 AND VIL_WY-12<VIL_MY AND VIL_MY<VIL_WY-2 THEN
46485 GOSUB *VIL_VWMRESIZE
46490 ELSE IF (VIL_VWAT AND 8)= 8 AND VIL_WX- 6<VIL_MX AND VIL_MX<VIL_WW+6 AND VIL_WY-12<VIL_MY AND VIL_MY<VIL_WY-2 THEN
46495 GOSUB *VIL_VWMMOVE
46500 ENDIF
46505 RETURN
46515 *VIL_VWMMENU
46585 GOSUB *VIL_WPMA
46590 LINE(VIL_WX(VIL_WAN)+16,VIL_WY(VIL_WAN)-11) -(VIL_WW(VIL_WAN)-16,VIL_WY(VIL_WAN)- 4),XOR,%3,BF
46595 VIL_W1=VIL_VWAT
46600 VIL_WW=VIL_WX+49:VIL_WZ=VIL_WY+98
46605 VIL_VWT$="VWM":VIL_VWAT=0:VIL_VWN=0
46610 GOSUB *VIL_VWOPEN
46615 SYMBOL(5, 0),"<VWM>", 1,1,6
46620 SYMBOL(1, 20),"CLOSE", 1,1,%1-((VIL_W1 AND 2)= 2)*2
46625 SYMBOL(1, 36),"HIDE", 1,1,%1-((VIL_W1 AND 4)= 4)*2
46630 SYMBOL(1, 52),"MOVE", 1,1,%1-((VIL_W1 AND 8)= 8)*2
46635 SYMBOL(1, 68),"RESIZE",1,1,%1-((VIL_W1 AND 16)=16)*2
46640 SYMBOL(1, 84),"<INFO>",1,1,%3
46650 VIL_X=1:VIL_Y=20:VIL_W=VIL_X+47:VIL_Z=VIL_Y+14
46655 VIL_YL=16:VIL_XN=1:VIL_YN=5:VIL_BXDIR=0:VIL_BCE=0:VIL_C=15:VIL_MN=1
46660 GOSUB *VIL_MSEL
46665 IF VIL_KN=-1 OR (0<VIL_KN AND VIL_KN<5 AND (VIL_VWAT(VIL_WAN-1) AND 2^VIL_KN)=0) THEN 46660
46670 GOSUB *VIL_VWCLOSE
46675 GOSUB *VIL_WPMA
46680 LINE(VIL_WX(VIL_WAN)+16,VIL_WY(VIL_WAN)-11) -(VIL_WW(VIL_WAN)-16,VIL_WY(VIL_WAN)- 4),XOR,%3,BF
46685 GOSUB *VIL_WPMR
46690 IF VIL_KN<1 THEN RETURN
46700 ON VIL_KN GOTO 46710,46725,46740,46780,46820
46710 GOSUB *VIL_VWMCLOSE
46715 RETURN
46725 IF VIL_KY THEN GOSUB *VIL_VWMKHIDE ELSE GOSUB *VIL_VWMHIDE
46730 RETURN
46740 IF VIL_KY THEN
46745 GOSUB *VIL_VWMKMOVE
46750 ELSE
46755 VIL_MX=(VIL_WX+VIL_WW)\2:VIL_MY=VIL_WY-4:MOUSE 1,VIL_MX,VIL_MY
46760 GOSUB *VIL_VWMMOVE
46765 ENDIF
46770 RETURN
46780 IF VIL_KY THEN
46785 GOSUB *VIL_VWMKRESIZE
46790 ELSE
46795 VIL_MX=VIL_WW:VIL_MY=VIL_WY-6:MOUSE 1,VIL_MX,VIL_MY
46800 GOSUB *VIL_VWMRESIZE
46805 ENDIF
46810 RETURN
46820 VIL_WX=VIL_WX+(VIL_WX-448)*(VIL_WX>448)
46825 VIL_WY=VIL_WY+(VIL_WY-380)*(VIL_WY>380)
46830 GOSUB *VIL_VWMINF
46835 RETURN
46845 *VIL_VWMINF
46885 VIL_WW=VIL_WX+183:VIL_WZ=VIL_WY+91
46890 VIL_VWT$="VWM INFORMATION":VIL_VWAT=0:VIL_VWN=0
46895 VIL_E=0
46900 GOSUB *VIL_VWOPEN
46905 IF VIL_E=0 THEN
46910 VIL_W0$=FNVIL_P2S0$(VIL_WX(VIL_WAN-1),3)+"," +FNVIL_P2S0$(VIL_WY(VIL_WAN-1),3)+")"
46915 SYMBOL(8, 8),"POSITION:("+VIL_W0$,1,1,4
46920 VIL_W0$=FNVIL_P2S0$(VIL_WW(VIL_WAN-1)-VIL_WX(VIL_WAN-1)+1,3)+"×" +FNVIL_P2S0$(VIL_WZ(VIL_WAN-1)-VIL_WY(VIL_WAN-1)+1,3)
46925 SYMBOL(8,28),"SIZE : "+VIL_W0$,1,1,4
46930 VIL_W0$=FNVIL_P2S0$(VIL_WAN-1,3)+"/"+FNVIL_P2S0$(VIL_WANMAX,3)
46935 SYMBOL(8,48),"WINDOW : "+VIL_W0$,1,1,4
46940 VIL_W0$=FNVIL_P2S0$((VIL_WBUFMAX-VIL_WBUFO(VIL_WAN-1))\512,4)+"K/" +FNVIL_P2S0$(VIL_WBUFMAX\512,4)+"K"
46945 SYMBOL(8,68),"FREE : "+VIL_W0$,1,1,4
46950 GOSUB *VIL_MVWAIT
46955 GOSUB *VIL_VWCLOSE
46960 ENDIF
46965 RETURN
46975 *VIL_VWMMOVE
47045 MOUSE 2,VIL_MCA1$,VIL_MCD1$,VIL_MCX1,VIL_MCY1
47050 MOUSE 1,VIL_MX,VIL_MY,1
47055 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
47060 VIL_WX=VIL_WX-8:VIL_WY=VIL_WY-14:VIL_WW=VIL_WW+8:VIL_WZ=VIL_WZ+8
47065 MOUSE 4,VIL_VWXM+VIL_MX-VIL_WX-8,VIL_VWYM+VIL_MY-VIL_WY-14, VIL_VWWM+VIL_MX-VIL_WW+8,VIL_VWZM+VIL_MY-VIL_WZ+8
47070 VIL_W1=0:VIL_W2=0:VIL_W3=0:VIL_W4=0
47075 VIL_WW=VIL_WW-VIL_WX:VIL_WZ=VIL_WZ-VIL_WY
47080 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47085 WHILE MOUSE(2,0)
47090 VIL_MX=MOUSE(9):VIL_MY=MOUSE(10)
47095 IF VIL_MX OR VIL_MY THEN
47100 LINE(VIL_WX+VIL_W3,VIL_WY+VIL_W4)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47105 VIL_W1=VIL_W1+VIL_MX:VIL_W2=VIL_W2+VIL_MY
47110 VIL_W3=VIL_W1-VIL_W1 MOD VIL_VWXD
47115 VIL_W4=VIL_W2-VIL_W2 MOD VIL_VWYD
47120 LINE(VIL_WX+VIL_W3,VIL_WY+VIL_W4)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47125 ENDIF
47130 WEND
47135 VIL_WX=VIL_WX+VIL_W3:VIL_WY=VIL_WY+VIL_W4
47140 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47150 IF MOUSE(2,1) THEN
47155 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
47160 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
47165 ELSE
47170 VIL_WX=VIL_WX+8:VIL_WY=VIL_WY+14
47180 GOSUB *VIL_VWMMV
47185 ENDIF
47190 MOUSE 2,VIL_MCA0$,VIL_MCD0$,VIL_MCX0,VIL_MCY0
47195 MOUSE 4,0,0,639,479
47200 IF VIL_W0 THEN GOSUB *VIL_WPMR
47205 RETURN
47215 *VIL_VWMKMOVE
47275 WHILE INKEY$<>"":WEND
47280 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
47285 VIL_WX=VIL_WX-8:VIL_WY=VIL_WY-14
47290 VIL_WW=VIL_WW-VIL_WX+8:VIL_WZ=VIL_WZ-VIL_WY+8
47295 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47300 VIL_KY=0
47305 WHILE VIL_KY<>13 AND VIL_KY<>24 AND VIL_KY<>48
47310 VIL_K$=INKEY$:IF VIL_K$="" THEN 47310
47315 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47320 VIL_KY=ASC(VIL_K$)
47325 VIL_WX=VIL_WX+((VIL_KY=29)-(VIL_KY=28))*VIL_VWXD
47330 VIL_WX=VIL_WX-((VIL_WX+8<VIL_VWXM)-(VIL_VWWM<VIL_WX+VIL_WW-8)) *VIL_VWXD
47335 VIL_WX=VIL_WX+((VIL_KY=52 OR VIL_KY=22)-(VIL_KY=54 OR VIL_KY=23)) *VIL_VWXD*8
47340 VIL_WX=VIL_WX-((VIL_WX+8<VIL_VWXM)-(VIL_VWWM<VIL_WX+VIL_WW-8)) *VIL_VWXD*8
47350 VIL_WY=VIL_WY+((VIL_KY=30)-(VIL_KY=31))*VIL_VWYD
47355 VIL_WY=VIL_WY-((VIL_WY+14<VIL_VWYM)-(VIL_VWZM<VIL_WY+VIL_WZ-8)) *VIL_VWYD
47360 VIL_WY=VIL_WY+((VIL_KY=56 OR VIL_KY=11)-(VIL_KY=50 OR VIL_KY=127)) *VIL_VWYD*8
47365 VIL_WY=VIL_WY-((VIL_WY+14<VIL_VWYM)-(VIL_VWZM<VIL_WY+VIL_WZ-8)) *VIL_VWYD*8
47370 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47375 WEND
47380 LINE(VIL_WX,VIL_WY)-STEP(VIL_WW,VIL_WZ),XOR,7,B
47390 IF VIL_KY=13 THEN
47395 VIL_WX=VIL_WX+8:VIL_WY=VIL_WY+14
47400 GOSUB *VIL_VWMMV
47405 ELSE
47410 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
47415 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
47420 ENDIF
47425 IF VIL_W0 THEN GOSUB *VIL_WPMR
47430 RETURN
47440 *VIL_VWMMV
47515 VIL_E=0
47520 GET@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,VIL_WBUFO(VIL_WAN)
47525 IF VIL_E=0 THEN
47530 VIL_WW=VIL_WX+VIL_WW(VIL_WAN)-VIL_WX(VIL_WAN)
47535 VIL_WZ=VIL_WY+VIL_WZ(VIL_WAN)-VIL_WY(VIL_WAN)
47540 PUT@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN-1)
47545 GET@A(VIL_WX-8,VIL_WY-14)-(VIL_WW+8,VIL_WZ+8) ,VIL_WBUF%,VIL_WBUFO(VIL_WAN-1)
47550 PUT@A(VIL_WX-8,VIL_WY-14)-(VIL_WW+8,VIL_WZ+8) ,VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN)
47555 VIL_WX(VIL_WAN)=VIL_WX:VIL_WY(VIL_WAN)=VIL_WY
47560 VIL_WW(VIL_WAN)=VIL_WW:VIL_WZ(VIL_WAN)=VIL_WZ
47565 VIL_VWMR=8
47570 ELSE
47575 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
47580 VIL_VWMR=0
47585 ENDIF
47590 RETURN
47600 *VIL_VWMCLOSE
47640 GOSUB *VIL_VWCLOSE
47645 VIL_VWMR=2
47650 RETURN
47660 *VIL_VWMHIDE
47715 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
47720 GOSUB *VIL_VWMHD0
47725 IF VIL_E=0 THEN
47730 WHILE MOUSE(2,0):WEND
47735 GOSUB *VIL_VWMHD1
47740 VIL_VWMR=4
47745 ELSE
47750 VIL_VWMR=0
47755 ENDIF
47760 IF VIL_W0 THEN GOSUB *VIL_WPMR
47765 RETURN
47775 *VIL_VWMKHIDE
47830 WHILE INKEY$<>"":WEND
47835 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
47840 GOSUB *VIL_VWMHD0
47845 IF VIL_E=0 THEN
47850 WHILE INKEY$="":WEND
47855 GOSUB *VIL_VWMHD1
47860 VIL_VWMR=4
47865 ENDIF
47870 IF VIL_W0 THEN GOSUB *VIL_WPMR
47875 RETURN
47885 *VIL_VWMHD0
47930 VIL_E=0
47935 GET@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,VIL_WBUFO(VIL_WAN)
47940 IF VIL_E=0 THEN
47945 PUT@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN-1)
47950 ENDIF
47955 RETURN
47965 *VIL_VWMHD1
48005 PUT@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN)
48010 RETURN
48020 *VIL_VWMHD2
48060 GET@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,VIL_WBUFO(VIL_WAN-1)
48065 PUT@A(VIL_WX(VIL_WAN)-8,VIL_WY(VIL_WAN)-14) -(VIL_WW(VIL_WAN)+8,VIL_WZ(VIL_WAN)+ 8) ,VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN)
48070 RETURN
48080 *VIL_VWMRESIZE
48160 MOUSE 2,VIL_MCA2$,VIL_MCD2$,VIL_MCX2,VIL_MCY2
48165 MOUSE 1,VIL_MX,VIL_MY,1
48170 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
48190 VIL_WX=VIL_WX-8:VIL_WY=VIL_WY-14:VIL_WW=VIL_WW+8:VIL_WZ=VIL_WZ+8
48195 VIL_W1=VIL_WW-VIL_VWWL-7-VIL_VWXM:VIL_W2=VIL_WZ-VIL_VWZL- 7-VIL_VWYM
48200 VIL_W3=VIL_WX+VIL_VWWL+7-VIL_VWWM:VIL_W4=VIL_WY+VIL_VWZL+13-VIL_VWZM
48220 MOUSE 4,VIL_VWXM-VIL_W1*(VIL_W1>0)-8,VIL_VWYM-VIL_W2*(VIL_W2>0)-14 ,VIL_VWWM-VIL_W3*(VIL_W3<0)+8,VIL_VWZM-VIL_W4*(VIL_W4<0)+ 8
48230 VIL_W1=2:VIL_W2=1
48235 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48240 WHILE MOUSE(2,0)
48245 IF MOUSE(9) OR MOUSE(10) THEN
48250 VIL_MX=MOUSE(0):VIL_MY=MOUSE(1)
48255 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48260 IF VIL_MX<=VIL_WX(VIL_WAN)-8 THEN
48265 VIL_WX=VIL_MX+(VIL_WX-VIL_MX) MOD VIL_VWWD
48270 VIL_WW=VIL_WW(VIL_WAN)+8:VIL_W1=1
48275 ELSE IF VIL_MX>=VIL_WW(VIL_WAN)+8 THEN
48280 VIL_WW=VIL_MX-(VIL_MX-VIL_WW) MOD VIL_VWWD
48285 VIL_WX=VIL_WX(VIL_WAN)-8:VIL_W1=2
48290 ELSE
48295 IF VIL_W1=1 THEN
48300 VIL_W3=VIL_WW-VIL_VWXL-15-VIL_MX
48305 VIL_W3=VIL_MX-VIL_W3*(VIL_W3<0)
48310 VIL_WX=VIL_W3+(VIL_WX-VIL_W3) MOD VIL_VWWD
48315 ELSE
48320 VIL_W3=VIL_WX+VIL_VWXL+15-VIL_MX
48325 VIL_W3=VIL_MX-VIL_W3*(VIL_W3>0)
48330 VIL_WW=VIL_W3-(VIL_W3-VIL_WW) MOD VIL_VWWD
48335 ENDIF
48340 ENDIF
48350 IF VIL_MY<=VIL_WY(VIL_WAN)-14 THEN
48355 VIL_WY=VIL_MY+(VIL_WY-VIL_MY) MOD VIL_VWZD
48360 VIL_WZ=VIL_WZ(VIL_WAN)+8:VIL_W2=1
48365 ELSE IF VIL_MY>=VIL_WZ(VIL_WAN)+8 THEN
48370 VIL_WZ=VIL_MY-(VIL_MY-VIL_WZ) MOD VIL_VWZD
48375 VIL_WY=VIL_WY(VIL_WAN)-14:VIL_W2=2
48380 ELSE
48385 IF VIL_W2=1 THEN
48390 VIL_W3=VIL_WZ-VIL_VWYL-21-VIL_MY
48395 VIL_W3=VIL_MY-VIL_W3*(VIL_W3<0)
48400 VIL_WY=VIL_W3+(VIL_WY-VIL_W3) MOD VIL_VWZD
48405 ELSE
48410 VIL_W3=VIL_WY+VIL_VWYL+21-VIL_MY
48415 VIL_W3=VIL_MY-VIL_W3*(VIL_W3>0)
48420 VIL_WZ=VIL_W3-(VIL_W3-VIL_WZ) MOD VIL_VWZD
48425 ENDIF
48430 ENDIF
48435 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48440 ENDIF
48445 WEND
48450 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48455 IF MOUSE(2,1) THEN
48460 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
48465 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
48470 ELSE
48475 VIL_WX=VIL_WX+8:VIL_WY=VIL_WY+14:VIL_WW=VIL_WW-8:VIL_WZ=VIL_WZ-8
48480 GOSUB *VIL_VWMRS
48485 ENDIF
48490 MOUSE 2,VIL_MCA0$,VIL_MCD0$,VIL_MCX0,VIL_MCY0
48495 MOUSE 4,0,0,639,479
48500 IF VIL_W0 THEN GOSUB *VIL_WPMR
48505 RETURN
48515 *VIL_VWMKRESIZE
48595 WHILE INKEY$<>"":WEND
48600 VIL_W0=VIL_WPM:GOSUB *VIL_WPMA
48620 VIL_WX=VIL_WX-8:VIL_WY=VIL_WY-14:VIL_WW=VIL_WW+8:VIL_WZ=VIL_WZ+8
48625 VIL_W3=VIL_WW-VIL_VWWL-7-VIL_VWXM:VIL_W4=VIL_WZ-VIL_VWZL- 7-VIL_VWYM
48630 VIL_W5=VIL_WX+VIL_VWWL+7-VIL_VWWM:VIL_W6=VIL_WY+VIL_VWZL+13-VIL_VWZM
48635 VIL_W3=VIL_VWXM-VIL_W3*(VIL_W3>0)-8
48640 VIL_W4=VIL_VWYM-VIL_W4*(VIL_W4>0)-14
48645 VIL_W5=VIL_VWWM-VIL_W5*(VIL_W5<0)+8
48650 VIL_W6=VIL_VWZM-VIL_W6*(VIL_W6<0)+8
48670 VIL_W1=2:VIL_W2=1
48675 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48680 VIL_KY=0
48685 WHILE VIL_KY<>13 AND VIL_KY<>24 AND VIL_KY<>48
48690 VIL_K$=INKEY$:IF VIL_K$="" THEN 48690
48695 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48700 VIL_KY=ASC(VIL_K$)
48705 VIL_W7=((VIL_KY=29)-(VIL_KY=28))*VIL_VWWD +((VIL_KY=52 OR VIL_KY=22)-(VIL_KY=54 OR VIL_KY=23))*VIL_VWWD*8
48715 IF VIL_W1=1 THEN
48720 VIL_WX=VIL_WX+VIL_W7
48725 IF VIL_WX<VIL_W3 THEN
48730 VIL_WW=VIL_W5-(VIL_W5-VIL_WW) MOD VIL_VWWD
48735 VIL_WX=VIL_WX(VIL_WAN)-8:VIL_W1=2
48740 ELSE IF VIL_WW-VIL_VWXL-15<VIL_WX THEN
48745 VIL_WX=VIL_WX(VIL_WAN)-8:VIL_W1=2
48750 VIL_WW=VIL_WX+VIL_VWXL+15 +(VIL_WW-VIL_WX-VIL_VWXL-15) MOD VIL_VWWD
48755 ENDIF
48760 ELSE
48765 VIL_WW=VIL_WW+VIL_W7
48770 IF VIL_WW<VIL_WX+VIL_VWXL+15 THEN
48775 VIL_WW=VIL_WW(VIL_WAN)+8:VIL_W1=1
48780 VIL_WX=VIL_WW-VIL_VWXL-15 +(VIL_WX-VIL_WW+VIL_VWXL+15) MOD VIL_VWWD
48785 ELSE IF VIL_W5<VIL_WW THEN
48790 VIL_WX=VIL_W3-(VIL_W3-VIL_WX) MOD VIL_VWWD
48795 VIL_WW=VIL_WW(VIL_WAN)+8:VIL_W1=1
48800 ENDIF
48805 ENDIF
48815 VIL_W7=((VIL_KY=30)-(VIL_KY=31))*VIL_VWZD +((VIL_KY=56 OR VIL_KY=11)-(VIL_KY=50 OR VIL_KY=127))*VIL_VWZD*8
48825 IF VIL_W2=1 THEN
48830 VIL_WY=VIL_WY+VIL_W7
48835 IF VIL_WY<VIL_W4 THEN
48840 VIL_WZ=VIL_W6-(VIL_W6-VIL_WZ) MOD VIL_VWZD
48845 VIL_WY=VIL_WY(VIL_WAN)-14:VIL_W2=2
48850 ELSE IF VIL_WZ-VIL_VWYL-21<VIL_WY THEN
48855 VIL_WY=VIL_WY(VIL_WAN)-14:VIL_W2=2
48860 VIL_WZ=VIL_WY+VIL_VWYL+21 +(VIL_WZ-VIL_WY-VIL_VWYL-21) MOD VIL_VWZD
48865 ENDIF
48870 ELSE
48875 VIL_WZ=VIL_WZ+VIL_W7
48880 IF VIL_WZ<VIL_WY+VIL_VWYL+21 THEN
48885 VIL_WZ=VIL_WZ(VIL_WAN)+8:VIL_W2=1
48890 VIL_WY=VIL_WZ-VIL_VWYL-21 +(VIL_WY-VIL_WZ+VIL_VWYL+21) MOD VIL_VWZD
48895 ELSE IF VIL_W6<VIL_WZ THEN
48900 VIL_WY=VIL_W4-(VIL_W4-VIL_WY) MOD VIL_VWZD
48905 VIL_WZ=VIL_WZ(VIL_WAN)+8:VIL_W2=1
48910 ENDIF
48915 ENDIF
48920 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48925 WEND
48935 LINE(VIL_WX,VIL_WY)-(VIL_WW,VIL_WZ),XOR,7,B
48940 IF VIL_KY=13 THEN
48945 VIL_WX=VIL_WX+8:VIL_WY=VIL_WY+14:VIL_WW=VIL_WW-8:VIL_WZ=VIL_WZ-8
48950 GOSUB *VIL_VWMRS
48955 ELSE
48960 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
48965 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
48970 ENDIF
48975 IF VIL_W0 THEN GOSUB *VIL_WPMR
48980 RETURN
48990 *VIL_VWMRS
49070 VIL_WBUFO(VIL_WAN+1)=VIL_WBUFO(VIL_WAN) +INT((INT((VIL_WW-VIL_WX+24)/8) *(VIL_WZ-VIL_WY+23)*4+1)/2)
49075 IF VIL_WBUFO(VIL_WAN+1)<VIL_WBUFO(VIL_WAN) THEN
49080 VIL_WBUFO(VIL_WAN+1)=VIL_WBUFO(VIL_WAN)
49085 ENDIF
49090 VIL_E=0
49095 GET@A(VIL_WX(VIL_WAN),VIL_WY(VIL_WAN)) -(VIL_WW(VIL_WAN),VIL_WZ(VIL_WAN)) ,VIL_WBUF%,VIL_WBUFO(VIL_WAN+1)
49100 VIL_W1=VIL_WW(VIL_WAN)-VIL_WX(VIL_WAN)
49105 VIL_W2=VIL_WZ(VIL_WAN)-VIL_WY(VIL_WAN)
49110 IF VIL_E=0 THEN
49115 VIL_WX(VIL_WAN+1)=VIL_WX:VIL_WY(VIL_WAN+1)=VIL_WY
49120 VIL_WW(VIL_WAN+1)=VIL_WW:VIL_WZ(VIL_WAN+1)=VIL_WZ
49125 GOSUB *VIL_VWCLOSE
49135 VIL_WX=VIL_WX(VIL_WAN+2):VIL_WY=VIL_WY(VIL_WAN+2)
49140 VIL_WW=VIL_WW(VIL_WAN+2):VIL_WZ=VIL_WZ(VIL_WAN+2)
49145 VIL_VWAT=VIL_VWAT(VIL_WAN+1):VIL_VWT$=VIL_VWT$(VIL_WAN+1)
49150 GOSUB *VIL_VWOPEN
49155 GOSUB *VIL_WPMR
49160 PUT@A(0,0)-(VIL_W1,VIL_W2),VIL_WBUF%,,,,,VIL_WBUFO(VIL_WAN+1)
49170 GOSUB *VIL_WPMA
49175 VIL_VWMR=16
49180 ELSE
49185 VIL_WX=VIL_WX(VIL_WAN):VIL_WY=VIL_WY(VIL_WAN)
49190 VIL_WW=VIL_WW(VIL_WAN):VIL_WZ=VIL_WZ(VIL_WAN)
49195 VIL_VWMR=0
49200 ENDIF
49205 RETURN
49235 *VIL_SEL_INITM
49285 RETURN
49295 *VIL_SEL_OK
49420 SYMBOL(VIL_X+4,VIL_Y+4),"確認",1,1,7
49425 LINE(VIL_X+ 2,VIL_Y+2)-(VIL_X+ 37,VIL_Y+21),PSET,7,B
49430 VIL_W=VIL_X+39:VIL_Z=VIL_Y+23
49435 VIL_XN=1:VIL_YN=1:VIL_C=15:VIL_MN=0:VIL_BCE=0
49440 GOSUB *VIL_MSEL
49445 GOSUB *VIL_BC
49450 RETURN
49460 *VIL_SEL_YN
49610 SYMBOL(VIL_X+4,VIL_Y+4),"はい いいえ",1,1,7
49615 LINE(VIL_X+ 2,VIL_Y+2)-(VIL_X+ 53,VIL_Y+21),PSET,7,B
49620 LINE(VIL_X+66,VIL_Y+2)-(VIL_X+117,VIL_Y+21),PSET,7,B
49625 VIL_W=VIL_X+55:VIL_Z=VIL_Y+23
49630 VIL_XL=64:VIL_XN=2:VIL_YN=1:VIL_C=15:VIL_BXDIR=0:VIL_MN=0:VIL_BCE=0
49635 GOSUB *VIL_MSEL
49640 GOSUB *VIL_BC
49645 IF VIL_KN=0 THEN VIL_KN=2
49650 RETURN
49660 *VIL_SEL_DO
49810 SYMBOL(VIL_X+4,VIL_Y+4),"実行 取消",1,1,7
49815 LINE(VIL_X+ 2,VIL_Y+2)-(VIL_X+37,VIL_Y+21),PSET,7,B
49820 LINE(VIL_X+50,VIL_Y+2)-(VIL_X+85,VIL_Y+21),PSET,7,B
49825 VIL_W=VIL_X+39:VIL_Z=VIL_Y+23
49830 VIL_XL=48:VIL_XN=2:VIL_YN=1:VIL_C=15:VIL_BXDIR=0:VIL_MN=0:VIL_BCE=0
49835 GOSUB *VIL_MSEL
49840 GOSUB *VIL_BC
49845 IF VIL_KN=0 THEN VIL_KN=2
49850 RETURN
50030 *VIL_UTY_VER
50035 VIL_VER=100
50040 RETURN
50070 *VIL_SYSCNF_INITM
50120 VIL_VWX(10)=VIL_W0 :VIL_VWY(10)=VIL_W1
50125 VIL_VWW(10)=VIL_W0+111:VIL_VWZ(10)=VIL_W1+79
50135 RETURN
50145 *VIL_SYSCNF
50185 VIL_VWN=10:VIL_VWAT=15:VIL_VWT$="SYSTEM"
50190 GOSUB *VIL_VWOPEN
50195 SYMBOL(8, 8),"システム設定",1,1,6
50200 SYMBOL(8,36),"1 BGM設定",1,1,7
50205 SYMBOL(8,56),"2 色設定 ",1,1,7
50215 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
50220 WHILE VIL_VWMR<>2
50225 VIL_X=4:VIL_Y=34:VIL_W=VIL_X+103:VIL_Z=VIL_Y+19
50230 VIL_YL=20:VIL_XN=1:VIL_YN=2:VIL_BXDIR=0:VIL_C=15:VIL_MN=10
50235 GOSUB *VIL_MSEL
50240 IF VIL_KN<0 THEN
50245 GOSUB *VIL_VWMCHECK
50250 ELSE IF VIL_KN=0 THEN
50255 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
50260 ELSE
50265 GOSUB *VIL_GBEEP
50270 ON VIL_KN GOSUB *VIL_BGM,*VIL_COLCNF
50275 VIL_VWMR=0
50280 ENDIF
50285 WEND
50290 RETURN
50320 *VIL_COLCNF_INITM
50390 VIL_INT=VIL_W4
50395 VIL_INTINIT=VIL_W4
50400 DIM VIL_P(2)
50405 DIM VIL_VWP(2)
50410 DIM VIL_VWPINIT(2)
50415 VIL_VWP(0)=VIL_W5:VIL_VWPINIT(0)=VIL_W5
50420 VIL_VWP(1)=VIL_W6:VIL_VWPINIT(1)=VIL_W6
50425 VIL_VWP(2)=VIL_W7:VIL_VWPINIT(2)=VIL_W7
50435 GOSUB *VIL_COLCNF_INIT
50445 VIL_VWX(20)=VIL_W0 :VIL_VWY(20)=VIL_W1
50450 VIL_VWW(20)=VIL_W0+159:VIL_VWZ(20)=VIL_W1+99
50455 VIL_VWX(21)=VIL_W2 :VIL_VWY(21)=VIL_W3
50460 VIL_VWW(21)=VIL_W2+159:VIL_VWZ(21)=VIL_W3+99
50465 RETURN
50475 *VIL_COLCNF_INIT
50515 VIL_INT=VIL_INTINIT
50520 IF VIL_INT THEN VIL_K=255 ELSE VIL_K=192
50525 GOSUB *VIL_INTSET
50530 VIL_VWP(0)=VIL_VWPINIT(0)
50535 VIL_VWP(1)=VIL_VWPINIT(1)
50540 VIL_VWP(2)=VIL_VWPINIT(2)
50545 GOSUB *VIL_WPALSET
50550 RETURN
50560 *VIL_WPALSET
50600 PALETTE 1,[VIL_VWP(0)-80+(VIL_VWP(0)<80)*(VIL_VWP(0)-80) ,VIL_VWP(1)-80+(VIL_VWP(1)<80)*(VIL_VWP(1)-80) ,VIL_VWP(2)-80+(VIL_VWP(2)<80)*(VIL_VWP(2)-80)],1
50605 PALETTE 2,[VIL_VWP(0),VIL_VWP(1),VIL_VWP(2)],1
50610 PALETTE 3,[VIL_VWP(0)+80+(VIL_VWP(0)>175)*(VIL_VWP(0)-175) ,VIL_VWP(1)+80+(VIL_VWP(1)>175)*(VIL_VWP(1)-175) ,VIL_VWP(2)+80+(VIL_VWP(2)>175)*(VIL_VWP(2)-175)],1
50615 RETURN
50625 *VIL_COLCNF
50715 VIL_VWN=20:VIL_VWAT=15:VIL_VWT$="COLOR"
50720 GOSUB *VIL_VWOPEN
50725 SYMBOL(8, 8)," 色設定 ",1,1,6
50730 SYMBOL(8,36),"1 表示 ["+KMID$("低高",1-VIL_INT,1)+"輝度]",1,1,7
50735 SYMBOL(8,56),"2 パレット初期化",1,1,7
50740 SYMBOL(8,76),"3 ウィンドウ色設定",1,1,7
50750 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
50755 WHILE VIL_VWMR<>2
50760 VIL_X=4:VIL_Y=34:VIL_W=VIL_X+151:VIL_Z=VIL_Y+19
50765 VIL_YL=20:VIL_XN=1:VIL_YN=3:VIL_BXDIR=0:VIL_C=15:VIL_MN=20
50770 GOSUB *VIL_MSEL
50775 IF VIL_KN<0 THEN
50780 GOSUB *VIL_VWMCHECK
50785 ELSE IF VIL_KN=0 THEN
50790 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
50795 ELSE
50800 GOSUB *VIL_GBEEP
50805 ON VIL_KN GOSUB 50855,*VIL_COLCNF_INIT,50885
50810 VIL_X=88:VIL_Y=36:VIL_L=2:VIL_C=15:VIL_CB=VIL_VWCB
50815 VIL_A$=KMID$("低高",1-VIL_INT,1)
50820 GOSUB *VIL_GPRINT
50825 VIL_VWMR=0
50830 ENDIF
50835 WEND
50840 RETURN
50855 VIL_INT=NOT VIL_INT
50860 IF VIL_INT THEN VIL_K=255 ELSE VIL_K=192
50865 GOSUB *VIL_INTSET
50870 RETURN
50885 VIL_P(0)=VIL_VWP(0):VIL_P(1)=VIL_VWP(1):VIL_P(2)=VIL_VWP(2):VIL_P=2
50890 GOSUB *VIL_PALCNF
50895 VIL_VWP(0)=VIL_P(0):VIL_VWP(1)=VIL_P(1):VIL_VWP(2)=VIL_P(2)
50900 GOSUB *VIL_WPALSET
50905 RETURN
50915 *VIL_INTSET
50955 PALETTE 9,[ 0, 0,VIL_K],1
50960 PALETTE 10,[ 0,VIL_K, 0],1
50965 PALETTE 11,[ 0,VIL_K,VIL_K],1
50970 PALETTE 12,[VIL_K, 0, 0],1
50975 PALETTE 13,[VIL_K, 0,VIL_K],1
50980 PALETTE 14,[VIL_K,VIL_K, 0],1
50985 PALETTE 15,[VIL_K,VIL_K,VIL_K],1
50990 RETURN
51000 *VIL_PALCNF
51065 VIL_VWN=21:VIL_VWAT=15:VIL_VWT$="PALETTE"
51070 GOSUB *VIL_VWOPEN
51075 SYMBOL(32,8),"パレット設定",1,1,6
51080 LINE( 8,8)-( 23,24),PSET,%VIL_P,BF
51085 LINE(136,8)-(151,24),PSET,%VIL_P,BF
51095 GOSUB 51330
51100 FOR VIL_I=2 TO 0 STEP -1
51105 SYMBOL( 8,VIL_I*20+36),MID$("GRB",3-VIL_I,1),1,1,4-VIL_I+(VIL_I>0)
51110 SYMBOL(16,VIL_I*20+36),"( )",1,1,7
51115 FOR VIL_J=1 TO 3
51120 LINE(VIL_BXX(VIL_I*3+VIL_J)+2,VIL_BXY(VIL_I*3+VIL_J)+2) -(VIL_BXW(VIL_I*3+VIL_J)-2,VIL_BXZ(VIL_I*3+VIL_J)-2),PSET,7,B
51125 NEXT
51130 SYMBOL( 48,VIL_I*20+36),"〈",1,1,7
51135 SYMBOL(141,VIL_I*20+36),"〉",1,1,7
51140 GOSUB 51280
51145 NEXT
51155 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
51160 WHILE VIL_VWMR<>2
51165 VIL_XN=3:VIL_YN=3:VIL_BXDIR=4:VIL_C=15:VIL_MN=21
51170 GOSUB *VIL_MSELIN
51175 IF VIL_KN<0 THEN
51180 GOSUB *VIL_VWMCHECK
51185 GOSUB 51330
51190 ELSE IF VIL_KN=0 THEN
51195 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
51200 ELSE
51205 VIL_I=2-(VIL_KN-1)\3
51210 VIL_J=VIL_KN MOD 3
51215 IF VIL_J=2 THEN
51225 ELSE
51230 VIL_P(VIL_I)=VIL_P(VIL_I)+((VIL_J=1)-(VIL_J=0))*16
51235 VIL_P(VIL_I)=VIL_P(VIL_I) +((255<VIL_P(VIL_I))-(VIL_P(VIL_I)<0))*256
51240 ENDIF
51245 GOSUB 51280
51250 PALETTE VIL_P,[VIL_P(0),VIL_P(1),VIL_P(2)],1
51255 ENDIF
51260 WEND
51265 RETURN
51280 VIL_X=24:VIL_Y=VIL_I*20+36
51285 VIL_A$=FNVIL_P2SS$(VIL_P(VIL_I)\16,2):VIL_L=2:VIL_C=15:VIL_CB=VIL_VWCB
51290 GOSUB *VIL_GPRINT
51295 LINE(72,VIL_I*20+37)-(131,VIL_I*20+50),PSET,%VIL_VWCB,BF
51300 IF VIL_P(VIL_I)\16 THEN
51305 LINE(72,VIL_I*20+37)-(71+(VIL_P(VIL_I)\16)*4,VIL_I*20+50),PSET ,4-VIL_I+(VIL_I>0),BF
51310 ENDIF
51315 RETURN
51330 FOR VIL_I=0 TO 2
51335 VIL_BXX(VIL_I*3+1)= 50:VIL_BXY(VIL_I*3+1)=74-VIL_I*20
51340 VIL_BXW(VIL_I*3+1)= 69:VIL_BXZ(VIL_I*3+1)=93-VIL_I*20
51345 VIL_BXX(VIL_I*3+2)= 69:VIL_BXY(VIL_I*3+2)=74-VIL_I*20
51350 VIL_BXW(VIL_I*3+2)=134:VIL_BXZ(VIL_I*3+2)=93-VIL_I*20
51355 VIL_BXX(VIL_I*3+3)=134:VIL_BXY(VIL_I*3+3)=74-VIL_I*20
51360 VIL_BXW(VIL_I*3+3)=153:VIL_BXZ(VIL_I*3+3)=93-VIL_I*20
51365 NEXT
51370 RETURN
51405 *VIL_BGM_INITM
51450 VIL_VWX(30)=VIL_W0 :VIL_VWY(30)=VIL_W1
51455 VIL_VWW(30)=VIL_W0+96:VIL_VWZ(30)=VIL_W1+79
51465 RETURN
51475 *VIL_BGM
51555 VIL_VWN=30:VIL_VWAT=15:VIL_VWT$="BGM"
51560 GOSUB *VIL_VWOPEN
51565 SYMBOL(8, 8),"BGM設定",1,1,6
51570 SYMBOL(8,36),"1 FM音源",1,1,7
51575 SYMBOL(8,56),"2 CDDA",1,1,7
51585 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
51590 WHILE VIL_VWMR<>2
51595 VIL_X=4:VIL_Y=34:VIL_W=VIL_X+87:VIL_Z=VIL_Y+19
51600 VIL_YL=20:VIL_XN=1:VIL_YN=2:VIL_BXDIR=0:VIL_C=15:VIL_MN=30
51605 GOSUB *VIL_MSEL
51610 IF VIL_KN<0 THEN
51615 GOSUB *VIL_VWMCHECK
51620 ELSE IF VIL_KN=0 THEN
51625 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
51630 ELSE
51635 GOSUB *VIL_GBEEP
51640 ON VIL_KN GOSUB *VIL_BGMFM,*VIL_BGMCD
51645 VIL_VWMR=0
51650 ENDIF
51655 WEND
51660 RETURN
51690 *VIL_BGMFM_INITM
51750 DIM VIL_FM0$(VIL_W4),VIL_FM1$(VIL_W4)
51755 DIM VIL_FM2$(VIL_W4),VIL_FM3$(VIL_W4)
51760 DIM VIL_FM4$(VIL_W4),VIL_FM5$(VIL_W4)
51765 DIM VIL_FMT$(VIL_W5)
51770 DIM VIL_FMN$(VIL_W5)
51780 VIL_FMF=0
51785 VIL_FMSP=0
51790 VIL_FMLS=-1
51795 VIL_FMLB=0:VIL_FMLE=0:VIL_FMME=0
51800 VIL_FMTMAX=0
51805 VIL_VWX(31)=VIL_W0 :VIL_VWY(31)=VIL_W1
51810 VIL_VWW(31)=VIL_W0+175:VIL_VWZ(31)=VIL_W1+ 79
51815 VIL_VWX(32)=VIL_W2 :VIL_VWY(32)=VIL_W3
51820 VIL_VWW(32)=VIL_W2+287:VIL_VWZ(32)=VIL_W3+223
51830 GOSUB *VIL_FMTREAD
51835 RETURN
51845 *VIL_BGMFM
51930 VIL_VWN=31:VIL_VWAT=15:VIL_VWT$="BGM FM"
51935 GOSUB *VIL_VWOPEN
51940 IF VIL_CDF THEN GOSUB *VIL_CDOFF
51945 SYMBOL(8,8)," FM音源BGM ",1,1,6
51950 SYMBOL(8,36),"1 BGM ["+KMID$("OFFON ",1-VIL_FMF*3,3)+"]" ,1,1,7
51955 SYMBOL(8,56),"2 曲選択",1,1,7
51965 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
51970 WHILE VIL_VWMR<>2
51975 VIL_X=4:VIL_Y=34:VIL_W=VIL_X+167:VIL_Z=VIL_Y+19
51980 VIL_YL=20:VIL_XN=1:VIL_YN=2:VIL_BXDIR=0:VIL_C=15:VIL_MN=31
51985 GOSUB *VIL_MSEL
51990 IF VIL_KN<0 THEN
51995 GOSUB *VIL_VWMCHECK
52000 ELSE IF VIL_KN=0 THEN
52005 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
52010 ELSE
52015 GOSUB *VIL_GBEEP
52020 ON VIL_KN GOSUB 52070,*VIL_FMSEL
52025 VIL_X=104:VIL_Y=36:VIL_L=6:VIL_C=15:VIL_CB=VIL_VWCB
52030 VIL_A$=KMID$("OFFON ",1-VIL_FMF*3,3)
52035 GOSUB *VIL_GPRINT
52040 VIL_VWMR=0
52045 ENDIF
52050 WEND
52055 RETURN
52070 IF VIL_FMF THEN
52075 GOSUB *VIL_FMOFF
52080 ELSE
52085 IF VIL_FMINIT$="" THEN
52090 GOSUB *VIL_BBEEP
52100 ELSE
52105 GOSUB *VIL_FMON
52110 ENDIF
52115 ENDIF
52120 RETURN
52130 *VIL_FMSEL
52220 VIL_VWN=32:VIL_VWAT=15:VIL_VWT$="BGM SELECT"
52225 GOSUB *VIL_VWOPEN
52230 SYMBOL(8,8)," FM音源BGM 曲選択",1,1,6
52240 GOSUB 52380
52250 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
52255 WHILE VIL_VWMR<>2
52260 VIL_X=4:VIL_Y=34:VIL_W=VIL_X+279:VIL_Z=VIL_Y+19
52265 VIL_YL=20:VIL_XN=1:VIL_YN=9:VIL_BXDIR=0:VIL_C=15:VIL_MN=32
52270 GOSUB *VIL_MSEL
52275 IF VIL_KN<0 THEN
52280 GOSUB *VIL_VWMCHECK
52285 ELSE IF VIL_KN=0 THEN
52290 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
52295 ELSE
52300 IF VIL_KN=9 THEN
52305 VIL_FMSP=VIL_FMSP+8:IF VIL_FMSP>VIL_FMTMAX THEN VIL_FMSP=0
52310 GOSUB 52380
52315 ELSE IF VIL_FMSP+VIL_KN-2<VIL_FMTMAX THEN
52320 VIL_W0=INSTR(VIL_FMN$(VIL_FMSP+VIL_KN-1),"/")
52325 VIL_F$=LEFT$(VIL_FMN$(VIL_FMSP+VIL_KN-1),VIL_W0-1)
52330 VIL_A$= MID$(VIL_FMN$(VIL_FMSP+VIL_KN-1),VIL_W0+1)
52340 GOSUB *VIL_FMDREAD
52345 ENDIF
52350 VIL_VWMR=0
52355 ENDIF
52360 WEND
52365 RETURN
52380 VIL_L=34:VIL_C=15:VIL_CB=VIL_VWCB
52385 FOR VIL_I=0 TO 7
52390 VIL_X=8:VIL_Y=VIL_I*20+36
52395 VIL_A$=HEX$(VIL_I+1)
52400 IF VIL_FMSP+VIL_I<=VIL_FMTMAX THEN VIL_A$=VIL_A$+" "+VIL_FMT$(VIL_FMSP+VIL_I)
52405 GOSUB *VIL_GPRINT
52410 NEXT
52415 SYMBOL(8,196),"9 ~ 次頁 ~",1,1,7
52420 RETURN
52430 *VIL_FMTREAD
52470 VIL_E=0
52475 OPEN "I",#1,VIL_FMTDIR$+"FM_TITLE.VIL"
52480 IF VIL_E=0 THEN
52485 INPUT #1,VIL_FMTMAX:VIL_FMTMAX=VIL_FMTMAX-1
52490 FOR VIL_I=0 TO VIL_FMTMAX
52495 LINE INPUT #1,VIL_FMT$(VIL_I)
52500 LINE INPUT #1,VIL_FMN$(VIL_I)
52505 NEXT
52510 CLOSE #1
52515 ENDIF
52520 RETURN
52530 *VIL_FMDREAD
52630 VIL_W0=VIL_FMF
52635 IF VIL_W0 THEN GOSUB *VIL_FMOFF
52640 VIL_A$=":"+VIL_A$
52645 IF LEFT$(VIL_F$,1)<>"\" AND MID$(VIL_F$,2,1)<>":" THEN
52650 VIL_F$=VIL_FMTDIR$+VIL_F$
52655 ENDIF
52660 OPEN "I",#1,VIL_F$
52665 GOSUB 52795:IF VIL_W0$<>VIL_A$ THEN 52665
52670 GOSUB 52795
52675 IF VIL_W0$="*" THEN
52680 LOAD@
52685 ELSE
52690 IF LEFT$(VIL_W0$,1)<>"\" AND MID$(VIL_W0$,2,1)<>":" THEN
52695 VIL_W0$=VIL_FMTDIR$+VIL_W0$
52700 ENDIF
52705 LOAD@ VIL_W0$
52710 ENDIF
52715 GOSUB 52795:VIL_FMLB=VAL(VIL_W0$)
52720 GOSUB 52795:VIL_FMLE=VAL(VIL_W0$)
52725 GOSUB 52795:VIL_FMME=VAL(VIL_W0$)
52730 GOSUB 52795:VIL_FMINIT$=VIL_W0$
52740 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM0$(VIL_I)=VIL_W0$:NEXT
52745 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM1$(VIL_I)=VIL_W0$:NEXT
52750 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM2$(VIL_I)=VIL_W0$:NEXT
52755 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM3$(VIL_I)=VIL_W0$:NEXT
52760 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM4$(VIL_I)=VIL_W0$:NEXT
52765 FOR VIL_I=0 TO VIL_FMME:GOSUB 52795:VIL_FM5$(VIL_I)=VIL_W0$:NEXT
52770 CLOSE #1
52775 IF VIL_W0 THEN GOSUB *VIL_FMON
52780 RETURN
52795 LINE INPUT #1,VIL_W0$:IF LEFT$(VIL_W0$,1)="'" THEN 52795
52800 RETURN
52810 *VIL_FMON
52850 VIL_FMF=-1:VIL_FMP=0:VIL_FMT=0
52855 PLAY VIL_FMINIT$
52860 GOSUB *VIL_FMDRV
52865 ON INTERVAL GOSUB *VIL_FMDRV:INTERVAL 1:INTERVAL ON
52870 RETURN
52880 *VIL_FMOFF
52920 VIL_FMF=0:INTERVAL OFF:PLAY OFF
52925 RETURN
52935 *VIL_FMDRV
52975 IF PLAY(1)>=VIL_FMP-1 THEN
52980 VIL_FMP=VIL_FMP+.125!
52985 PLAY VIL_FM0$(VIL_FMT),VIL_FM1$(VIL_FMT),VIL_FM2$(VIL_FMT), VIL_FM3$(VIL_FMT),VIL_FM4$(VIL_FMT),VIL_FM5$(VIL_FMT)
52990 VIL_FMT=VIL_FMT+1
52995 IF VIL_FMT>VIL_FMLE AND VIL_FMLS THEN VIL_FMT=VIL_FMLB
53000 IF VIL_FMT>VIL_FMME THEN INTERVAL OFF:VIL_FMF=0
53005 ENDIF
53010 RETURN
53155 *VIL_BGMCD_INITM
53200 DIM VIL_CDI%(5),VIL_CDS%(8)
53205 VIL_CDF=0
53210 VIL_CDTS=0
53215 VIL_CDMS=0
53220 VIL_CDPN=1
53225 VIL_VWX(33)=VIL_W0 :VIL_VWY(33)=VIL_W1
53230 VIL_VWW(33)=VIL_W0+243:VIL_VWZ(33)=VIL_W1+115
53240 RETURN
53250 *VIL_BGMCD
53340 VIL_VWN=33:VIL_VWAT=15:VIL_VWT$="BGM CD"
53345 GOSUB *VIL_VWOPEN
53350 IF VIL_FMF THEN GOSUB *VIL_FMOFF
53355 LINE(0,0)-(243,115),PSET,%2,BF
53360 SYMBOL(57,4),"CDDA BGM-PLAYER",1,1,4,,,3
53365 FOR VIL_I=26 TO 72 STEP 46
53370 FOR VIL_J=52 TO 152 STEP 50
53375 LINE(VIL_J,VIL_I)-(VIL_J+39,VIL_I+37),PSET,%VIL_VWCB,BF
53380 NEXT
53385 NEXT
53395 LINE( 6,72)-( 41,109),PSET,%VIL_VWCB,BF
53400 LINE(202,72)-(237,109),PSET,%VIL_VWCB,BF
53410 VIL_E=0
53415 CDINF VIL_CDI%
53420 IF VIL_E THEN
53425 VIL_WX=VIL_WX+2:VIL_WY=VIL_WY+64
53430 VIL_WW=VIL_WX+239:VIL_WZ=VIL_WY+31
53435 VIL_VWAT=0:VIL_VWT$="ERROR":VIL_VWN=0
53440 GOSUB *VIL_VWOPEN
53445 SYMBOL(8,8),"CDがセットされていません。",1,1,7
53450 GOSUB *VIL_MVWAIT
53455 GOSUB *VIL_VWCLOSE:GOSUB *VIL_VWCLOSE
53460 ELSE
53465 IF VIL_CDI%(1)=3 THEN VIL_CDI%(1)=2
53470 IF VIL_CDPN<VIL_CDI%(1) THEN VIL_CDPN=VIL_CDI%(1)
53475 IF VIL_CDI%(5)<VIL_CDPN THEN VIL_CDPN=VIL_CDI%(1)
53485 SYMBOL( 56,28),"MODE",1,1,7
53490 SYMBOL(110,28),"BGM",1,1,7
53495 SYMBOL(156,28),"TEST",1,1,7
53500 SYMBOL( 57,76),"<",2,2,7
53505 SYMBOL(157,76),">",2,2,7
53510 SYMBOL( 8,76),FNVIL_P2S0$(VIL_CDI%(1),2),2,2,7
53515 SYMBOL(204,76),FNVIL_P2S0$(VIL_CDI%(5),2),2,2,7
53520 SYMBOL(106,76),FNVIL_P2S0$(VIL_CDPN,2),2,2,7
53525 GOSUB 53855
53530 GOSUB 53835
53540 VIL_BCE=0:VIL_VWMR=0:VIL_KN=-1
53545 WHILE VIL_VWMR<>2
53550 VIL_X=50:VIL_Y=24+46:VIL_W=VIL_X+43:VIL_Z=VIL_Y+41
53555 VIL_XL=50:VIL_YL=46:VIL_XN=3:VIL_YN=2:VIL_BXDIR=4:VIL_C=15
53560 VIL_MN=33
53565 GOSUB *VIL_MSEL
53570 IF VIL_KN<0 THEN
53575 GOSUB *VIL_VWMCHECK
53580 ELSE IF VIL_KN=0 THEN
53585 GOSUB *VIL_VWCLOSE:VIL_VWMR=2
53590 ELSE
53595 ON VIL_KN GOSUB 53725,53740,53815,53635,53655,53705
53600 VIL_VWMR=0
53605 ENDIF
53610 WEND
53615 ENDIF
53620 RETURN
53635 VIL_CDMS=NOT VIL_CDMS
53640 GOSUB 53855
53645 RETURN
53655 VIL_CDF=NOT VIL_CDF
53660 IF VIL_CDF THEN
53665 INTERVAL 1:ON INTERVAL GOSUB *VIL_CDDRV:INTERVAL ON
53670 GOSUB *VIL_CDDRV
53675 ELSE
53680 INTERVAL OFF:CD STOP
53685 ENDIF
53690 GOSUB 53855
53695 RETURN
53705 VIL_CDTS=NOT VIL_CDTS
53710 GOSUB 53855
53715 RETURN
53725 VIL_CDPN=VIL_CDPN-1:IF VIL_CDPN<VIL_CDI%(1) THEN VIL_CDPN=VIL_CDI%(5)
53730 GOSUB 53830:RETURN
53740 VIL_WX=VIL_WX+64:VIL_WY=VIL_WY+32:VIL_WW=VIL_WX+111:VIL_WZ=VIL_WY+51
53745 VIL_VWAT=0:VIL_VWT$="INPUT":VIL_VWN=0
53750 GOSUB *VIL_VWOPEN
53755 SYMBOL(8,8),"トラック番号",1,1,6
53760 VIL_X=32:VIL_Y=28:VIL_L=2:VIL_C=15:VIL_CB=VIL_VWBC:VIL_A$=""
53765 GOSUB *VIL_INPSTR
53770 IF VIL_A$>"" THEN
53775 IF VAL(VIL_A$)<VIL_CDI%(1) OR VIL_CDI%(5)<VAL(VIL_A$) THEN
53780 GOSUB *VIL_BBEEP:GOTO 53765
53785 ENDIF
53790 ENDIF
53795 GOSUB *VIL_VWCLOSE
53800 IF VIL_A$>"" THEN VIL_CDPN=VAL(VIL_A$):GOSUB 53830
53805 RETURN
53815 VIL_CDPN=VIL_CDPN+1:IF VIL_CDPN>VIL_CDI%(5) THEN VIL_CDPN=VIL_CDI%(1)
53820 GOSUB 53830:RETURN
53830 IF VIL_CDTS=-1 THEN CD PLAY VIL_CDPN
53835 LINE(102,72)-(141,109),PSET,%VIL_VWCB,BF
53840 SYMBOL(106,76),FNVIL_P2S0$(VIL_CDPN,2),2,2,7
53845 RETURN
53855 LINE(60,46)-(83,61),PSET,%VIL_VWCB,BF
53860 SYMBOL(60,46),MID$("ONEALL",1-VIL_CDMS*3,3),1,1,7
53865 LINE(110,46)-(133,61),PSET,%VIL_VWCB,BF
53870 SYMBOL(110,46),MID$("OFFON",1-VIL_CDF*3,3),1,1,7
53875 LINE(162,46)-(185,61),PSET,%VIL_VWCB,BF
53880 SYMBOL(162,46),MID$("OFFON",1-VIL_CDTS*3,3),1,1,7
53885 RETURN
53895 *VIL_CDON
53935 VIL_CDF=-1
53940 GOSUB *VIL_CDDRV
53945 INTERVAL 1:ON INTERVAL GOSUB *VIL_CDDRV:INTERVAL ON
53950 RETURN
53960 *VIL_CDOFF
53995 VIL_CDF=0:INTERVAL OFF:CD STOP
54000 RETURN
54010 *VIL_CDDRV
54060 VIL_E=0
54065 CDSTAT VIL_CDS%
54070 IF VIL_E THEN
54075 VIL_CDF=0:INTERVAL OFF
54080 ELSE IF VIL_CDS%(1)=0 THEN
54085 IF VIL_CDMS THEN CD PLAY ELSE CD PLAY VIL_CDPN
54090 ENDIF
54095 RETURN